Repository navigation
ThinkHarness: an in-band model error ends the model call's read - #3433
Merged
Merged
Conversation
… provider that leaves its stream open after the error cannot hang the turn
|
| Name | Type |
|---|---|
| agents | Minor |
| @cloudflare/agent-think | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Contributor
|
✅ agents import sizes: no significant changes ( |
…t leaves its stream open
mattzcarey
marked this pull request as ready for review
November 27, 2026 09:14
…line for the in-band error fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ThinkHarness now stops reading a model call's stream at an in-band
error(orabort) chunk and fails the call with that error. Leaving the loop cancels the source. Before, the harness skipped the error chunk and kept reading, so a provider that reports an in-band error and leaves its stream open hung the turn until something cancelled it. Think ends the turn there.The in-band error is kept as the call's failure when the model reports no out-of-band error, so it goes through
onErrorandclassifyErroras before.Validated: the harness test "ends a model call at an in-band error even when the provider leaves its stream open" times out (30 s) without this change and passes with it. std's think-session test "terminates cleanly on an in-band stream error while the watchdog is armed" (#3419, with a provider that stays open after the error) times out on the harness config without this change and passes with it. The agents harness-think suite passes 148/148.
Cost: none. No rows, statements or KV ops change; the normal path is unchanged; an in-band error path stops reading at the error.