An incomplete streamed tool call can otherwise execute as a successful checkpoint. The runtime requires a complete stream and valid call identity/JSON; it rejects empty tool_calls and legacy function_call finishes, preserves returned Usage on terminal failure, and does not retry that failure. Streamed delta identity is carried to the single event owner.
Validation: both empty-terminal variants failed before the guard and passed afterward; GOWORK=off go vet ./... and GOWORK=off go test -count=1 ./... passed at a5e3c7c. Independent reviewer replayed both variants and retained Usage. Keep this PR draft until the U3 r0.4 model-quality and delivery gates pass.
Refs: U3 r0.4 design and implementation plan; Dev PR #512.
An incomplete streamed tool call can otherwise execute as a successful checkpoint. The runtime requires a complete stream and valid call identity/JSON; it rejects empty `tool_calls` and legacy `function_call` finishes, preserves returned Usage on terminal failure, and does not retry that failure. Streamed delta identity is carried to the single event owner.
Validation: both empty-terminal variants failed before the guard and passed afterward; `GOWORK=off go vet ./...` and `GOWORK=off go test -count=1 ./...` passed at a5e3c7c. Independent reviewer replayed both variants and retained Usage. Keep this PR draft until the U3 r0.4 model-quality and delivery gates pass.
Refs: U3 r0.4 design and implementation plan; Dev PR #512.
Why: a model tool finish could execute partial JSON or an unterminated SSE stream, while post-Usage errors could lose their charge.
Evidence: missing-DONE, malformed-JSON, identity, non-object and post-Usage RED→GREEN tests; GOWORK=off go vet ./... and go test -count=1 ./... passed.
Impact: invalid tool terminals fail without execution or automatic retry and retain returned Usage; valid text and multi-part tool streams keep working.
Refs: runtime/llm/sse.go; runtime/loop.go
Why: Backend emitted tool deltas from a separate goroutine, racing with serialized run events and occasionally losing a UI delta.
Evidence: Backend race detector reproduced concurrent event writes; Agent-Native identity test RED→GREEN; full vet and tests pass.
Impact: runtime tool delta events now carry provider slot and call ID for single-owner downstream projection.
Refs: runtime/loop.go; runtime/event_vocabulary_test.go
weichen
changed title from [WIP] Guard incomplete streamed tool calls to [WIP] Guard incomplete tool streams and preserve delta identity2026-10-14 02:25:40 +00:00
Why: A provider can report finish_reason=tool_calls without emitting any tool call. Treating it as a successful empty answer hides an incomplete operation.
Evidence: New SSE regression failed before the guard and passed afterward; full go vet and go test -count=1 ./... passed.
Impact: Inconsistent tool terminals fail closed while preserving returned Usage; valid text and tool streams are unchanged.
Refs: U3 r0.4 independent review issue 2
weichen
changed title from [WIP] Guard incomplete tool streams and preserve delta identity to [WIP] Guard streamed tool terminals and retain Usage2026-10-14 04:00:56 +00:00
Why: The parser also recognizes function_call as a tool finish, but cannot execute a legacy call when no deltas were collected. It must fail closed like tool_calls.
Evidence: The function_call variant failed before this guard and passed afterward; full Agent-Native vet/test passed.
Impact: Inconsistent legacy tool terminals fail with returned Usage preserved; valid streams are unchanged.
Refs: U3 r0.4 independent review Important 2 closure
Why: The r0.4 trial could prove that the parser missed [DONE] but could not distinguish clean EOF, malformed frames, read failure, or provider error without retaining raw SSE.
Evidence: RED receipts fast-slow-u3-r05-task1-terminal-red.json and task1-http-error-red.json; GREEN targeted receipt and full vet/test/race receipt fast-slow-u3-r05-task1-agent-native-full.json.
Impact: Add bounded scalar diagnostics and successful HTTP status to terminal events while preserving the existing incomplete-tool rejection, returned Usage, and retry behavior.
Refs: U3 r0.5 approved design and plan; Agent-Native PR #46
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
An incomplete streamed tool call can otherwise execute as a successful checkpoint. The runtime requires a complete stream and valid call identity/JSON; it rejects empty
tool_callsand legacyfunction_callfinishes, preserves returned Usage on terminal failure, and does not retry that failure. Streamed delta identity is carried to the single event owner.Validation: both empty-terminal variants failed before the guard and passed afterward;
GOWORK=off go vet ./...andGOWORK=off go test -count=1 ./...passed ata5e3c7c. Independent reviewer replayed both variants and retained Usage. Keep this PR draft until the U3 r0.4 model-quality and delivery gates pass.Refs: U3 r0.4 design and implementation plan; Dev PR #512.
[WIP] Guard incomplete streamed tool callsto [WIP] Guard incomplete tool streams and preserve delta identity[WIP] Guard incomplete tool streams and preserve delta identityto [WIP] Guard streamed tool terminals and retain Usage