Skip to content

ThinkHarness: an in-band model error ends the model call's read - #3433

Merged
mattzcarey merged 3 commits into
mainfrom
slim/harness-inband-error
Nov 27, 2026
Merged

mattzcarey merged 3 commits into
mainfrom
slim/harness-inband-error

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

ThinkHarness now stops reading a model call's stream at an in-band error (or abort) 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 onError and classifyError as 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.

… provider that leaves its stream open after the error cannot hang the turn
@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 353ed29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 2 packages
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

@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@3433

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@3433

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@3433

hono-agents

npm i https://pkg.pr.new/hono-agents@3433

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@3433

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@3433

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@3433

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@3433

commit: 353ed29

@agent-think

agent-think Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (6c01ac0c → 353ed290, workflow run)

@mattzcarey
mattzcarey marked this pull request as ready for review November 27, 2026 09:14
devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey
mattzcarey merged commit bc3b899 into main Nov 27, 2026
26 checks passed
@mattzcarey
mattzcarey deleted the slim/harness-inband-error branch November 27, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant