diff --git a/docs/architecture.md b/docs/architecture.md index 4780c4075..2d4995b3d 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -486,7 +486,9 @@ The central DB session row creation is the serialization point. No provider sess ### Output Delivery -NanoClaw does not stream tokens to users. The provider's query interface yields complete results. The agent-runner writes one complete message to messages_out per result. The host delivers complete messages to channels. +NanoClaw does not stream tokens to users. The provider's query interface yields complete results, but a result's text is not delivered as-is: the agent-runner parses it for `...` blocks (`dispatchResultText` in poll-loop.ts) and writes one messages_out row per block, addressed to that destination with its thread context resolved per destination. Everything outside a block — including `...` — is scratchpad: logged, never sent. A block naming an unknown destination is dropped into the scratchpad log. + +If a result produced text but no valid block, the agent-runner pushes a one-time `` nudge into the live turn asking the agent to re-wrap its response. The exception is a non-retryable error result (e.g. a billing error) with no envelope, which is delivered as an error notice instead of being dropped as scratchpad. Mid-turn interim updates go out through the `send_message` MCP tool; the final-text envelope parsing is how a turn's reply reaches the user. The host delivers complete messages_out rows to channels. Message editing is supported as an explicit operation (agent calls an `edit_message` tool), not as a streaming mechanism.