Skip to content

harness-backed Think: onChunk parts for tool progress, approved calls and invalid calls (group G) - #3438

Closed
mattzcarey wants to merge 14 commits into
slim/harness-score-hooks-15from
slim/harness-score-hooks-16
Closed

mattzcarey wants to merge 14 commits into
slim/harness-score-hooks-15from
slim/harness-score-hooks-16

Conversation

@mattzcarey

Copy link
Copy Markdown
Member

Group G, stacked on #3431. Devin's four threads on #3396, which is approved, fixed here instead of there:

  • Tool progress reaches onChunk. The harness gives a streaming tool's preliminary results to the host's onChunk hook as well as to its observers, and each is emitted once. As in the AI SDK, only an async generator's own iterable streams: an execute that returns a promise of one collapses to its last value, with no progress (executeTool).
  • An approved call's result is named. A call approved in an earlier turn runs in a new operation, which never streamed the call, so its tool-result/tool-error now take toolName and input from the transcript's tool part.
  • Extensions get the same parts as onChunk, as on Think.
  • An unparsable call (tool-input-error) is a tool-call with invalid: true and the error, as the AI SDK reports it.

Cost: a transcript scan for a result whose call this operation didn't stream. That only happens for approved calls.

Score on the harness config: hooks.test.ts 111 → 112 of 154 ("preserves preliminary chunks for an async-generator execute"; "collapses a Promise execute" still passes). The agents harness.test.ts passes 125 of 125.

Draft: the approved-call naming still needs its own test on both configs.

…step usage reach the step loop; beforeTurn's rewritten messages, a step's system message, tool time and the turn's signal as in Think
…result and error named with tool and input, and input deltas as delta, as the AI SDK's stream parts
…ll's parsed output is the operation's; runTurn's wait mode returns it
…m the think_final_answer tool, which is never stored
…ser message; activeTurnMetadata reads it, as on Think
…mpty channel name stamps nothing, as on Think
…e turn, as on Think; an overflow reaches onChatError classified
…p whose previous one crossed the budget, as on Think
…so a classifier can stop it; a stopped turn isn't compacted
…s, tool progress included; an approved call's result is named from the transcript; an unparsable call is an invalid tool-call; a promise of an iterable doesn't stream
@changeset-bot

changeset-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a78b763

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

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

@cloudflare/ai-chat

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

@cloudflare/codemode

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

hono-agents

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

@cloudflare/shell

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

@cloudflare/think

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

@cloudflare/voice

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

@cloudflare/worker-bundler

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

commit: a78b763

@agent-think

agent-think Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (74922b93 → a78b763a, workflow run)

@mattzcarey

Copy link
Copy Markdown
Member Author

Folded into #3431 (its commits are on top of #3431's branch).

@mattzcarey
mattzcarey force-pushed the slim/harness-score-hooks-15 branch from 74922b9 to 35e9e83 Compare November 27, 2026 11:05
@mattzcarey mattzcarey closed this Nov 27, 2026
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