Skip to content

ThinkHarness shell: a chat cleared under its turn is told so, with no response hook - #3402

Merged
mattzcarey merged 6 commits into
mainfrom
slim/harness-score-errors-2
Nov 27, 2026
Merged

mattzcarey merged 6 commits into
mainfrom
slim/harness-score-errors-2

Conversation

@mattzcarey

Copy link
Copy Markdown
Member

On the harness-backed Think shell, a turn the chat is cleared under now behaves as on Think: it gets no onChatResponse, and its chat() caller is told "The chat was cleared before the turn finished." Group H, slice 2, stacked on #3398.

Score on the harness config: think-session.test.ts goes from 115 / 322 (after #3398) to 118 / 324, with no test newly failing. The class suite passes 324/324. Class-only: this PR adds one row, so H has 2.

rv-3's watch point on #3398, measured on the class: a chat the chat is cleared under fires no onChatResponse, and its caller gets onError("The chat was cleared before the turn finished."). The shell instead reported aborted to onChatResponse, and told the caller nothing.

  • clearMessages now counts the clears in progress. A turn that ends aborted during one is recorded as cleared, and onTurnEnd skips its response hook.
  • chat() tells its caller of the clear, unless the caller's own signal had aborted.
  • New test on both configs: "tells a chat the chat was cleared under it, with no response hook".

The other reasons ThinkHarness can end a turn with (not_found, not_waiting, empty) are never reached by a turn that ran, which is all onTurnEnd sees here. I haven't found a public way to make a running turn end with them. If one turns up, it gets the same check.

Class-only row: "should persist partial assistant message on error" injects its failure through the private _transformInferenceResult seam. Its successor is new here, "keeps the partial reply of a turn whose model reports an error": the model beforeTurn gives writes text, then reports an in-band error. It passes on both configs.

No changeset: the shell isn't exported.

@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fe3a6c9

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 no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@agent-think

agent-think Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (a085150d → fe3a6c99, workflow run)

@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@3402

@cloudflare/ai-chat

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

@cloudflare/codemode

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

hono-agents

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

@cloudflare/shell

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

@cloudflare/think

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

@cloudflare/voice

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

@cloudflare/worker-bundler

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

commit: fe3a6c9

@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-1 branch from 1024830 to e45dc10 Compare November 27, 2026 06:32
@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-2 branch from 22dc9e5 to ed8cd24 Compare November 27, 2026 06:33
@mattzcarey
mattzcarey marked this pull request as ready for review November 27, 2026 06:42
devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-2 branch from 9077ccd to 965b72a Compare November 27, 2026 06:58
@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-1 branch from 2f78b6f to 489ffa2 Compare November 27, 2026 07:00
@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-2 branch 3 times, most recently from 8179afe to bfef429 Compare November 27, 2026 07:14
devin-ai-integration[bot]

This comment was marked as resolved.

Base automatically changed from slim/harness-score-errors-1 to main November 27, 2026 07:17
…ets no response hook; a public successor for the partial-reply test
…nd a turn its caller stopped first is not reported as cleared
@mattzcarey
mattzcarey force-pushed the slim/harness-score-errors-2 branch from bfef429 to c758b88 Compare November 27, 2026 07:17
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey
mattzcarey merged commit 9605681 into main Nov 27, 2026
27 of 29 checks passed
@mattzcarey
mattzcarey deleted the slim/harness-score-errors-2 branch November 27, 2026 07:49
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