What changed: a vendor that ends its 200 stream with finish_reason
"error" - WorkBuddy's and a DeepSeek harness's word for a turn it failed
rather than finished - had the chunk taken for content: the held stream
went to the agent, the try stood as a 200 success, and the group's next
member was never asked. streamEvent now reads the word as the failure it
says, held for the next candidate as an error event before content is;
in the candidate walk the try fails as an empty reply's or a cut-short
summary's does (#1221, #2274): the next is asked, and nobody rests, as
the reply's shape failed, not the account. Content already passed to the
agent can't be taken back, and is not touched.
Run: TestFinishReasonErrorFailsOver (new) red on a15e5765 before the fix
(the reporter's shape: one try, status 200, Fail empty, the second member
never asked), green after; red again with fallback.go and gateway.go
stashed, tests kept. TestStreamErrorBeforeContentFailsOver, the
streamEvent tables, and the stream families (Stream/Finish/Refusal/
Overload/LastOneLeft/GroupFail/Retry, Loop/Hold/Pass/Queue/Patience/
Incomplete/EndedShort/Grok) green. gofmt -l clean; vet on darwin, linux
(nogui) and windows clean; build ok on all three.
Review (magpie): the maintainer's call this waited on is made: the
literal "error" is a failure from any vendor, no vendor sends it for a
finished turn, so it is not keyed per vendor. Alone (no group), the
failure is the last one left's, tried again as a 502 is (15 asks in
the test's clock, the same count a plain 502 gets), then the vendor's
stream goes to the agent as it came. Content already shown is not taken
back. Not covered, still open on #2471: an empty response.completed
and a Chat stream with no finish_reason at all. Run on the Mac mini:
go test ./internal/gateway -count=1 ok. Broken by hand: fallback.go and
gateway.go at the base - TestFinishReasonErrorFailsOver (200, b never
asked) and the streamEvent table red. Not tried: a real WorkBuddy
reply ending so.
Generated-by: GLM-5.3-Flash (ZCode)