You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Harness: treat a direct Anthropic stream that ends without stop_reason as incomplete #269
#268 made the proxy report a stream that closes before its end marker as an error, so the CLI retracts the partial reply and starts the stream again. Providers in Anthropic format are called by the CLI directly, without the proxy, and that path still treats such a stream as a normal end.
After the stream ends, the CLI raises an error only when it saw no message_start, or saw no completed content block and no stop_reason (src/services/api/claude.ts:2413). A stream that completed one or more content blocks and then closed without a message_delta carrying stop_reason passes this check.
Scenario: a relay with a read timeout closes the connection halfway through a long answer, after a text block has finished. The user sees half an answer with no notice, the turn ends as if the model had finished, and nothing is retried.
Details, with how Codex CLI and ZCode handle a stream that ends early: P-RES-04.
Keep the existing case where stop_reason is present and there are no content blocks (a legitimate empty reply, see the comment above the check).
Update the status line of P-RES-04 in docs/features/harness/proxy/response.md.
Done when
A test streams message_start, a complete text block and then closes without message_delta, and shows the CLI retracting the reply and starting the stream again; the test fails on the current code. The empty reply with stop_reason still ends normally.
Activity