feat: make block streaming break configurable

This commit is contained in:
Peter Steinberger
2026-01-03 00:52:02 +01:00
parent ea7d967625
commit 2d28fa34f5
8 changed files with 138 additions and 31 deletions

View File

@@ -73,6 +73,7 @@ Legacy Pi/Tau session folders are **not** read.
Incoming user messages are queued while the agent is streaming. The queue is checked **after each tool call**. If a queued message is present, remaining tool calls from the current assistant message are skipped (error tool results with "Skipped due to queued user message."), then the queued user message is injected before the next assistant response.
Block streaming sends completed assistant blocks as soon as they finish; disable
via `agent.blockStreamingDefault: "off"` if you only want the final response.
Tune the boundary via `agent.blockStreamingBreak` (`text_end` vs `message_end`).
## Configuration (minimal)

View File

@@ -331,6 +331,7 @@ Controls the embedded agent runtime (model/thinking/verbose/timeouts).
thinkingDefault: "low",
verboseDefault: "off",
blockStreamingDefault: "on",
blockStreamingBreak: "text_end",
timeoutSeconds: 600,
mediaMaxMb: 5,
heartbeat: {
@@ -355,9 +356,13 @@ deprecation fallback.
Z.AI models are available as `zai/<model>` (e.g. `zai/glm-4.7`) and require
`ZAI_API_KEY` (or legacy `Z_AI_API_KEY`) in the environment.
`agent.blockStreamingDefault` controls whether completed assistant blocks
(`message_end` chunks) are sent immediately (default: `on`). Set to `off` to
only deliver the final consolidated reply.
`agent.blockStreamingDefault` controls whether completed assistant blocks are
sent immediately (default: `on`). Set to `off` to only deliver the final
consolidated reply.
`agent.blockStreamingBreak` controls what “block” means:
- `text_end` (default): end of each assistant text content block (before tool calls)
- `message_end`: end of the whole assistant message (may wait across tools)
`agent.heartbeat` configures periodic heartbeat runs:
- `every`: duration string (`ms`, `s`, `m`, `h`); default unit minutes. Omit or set