Repository navigation
fix/2185 approval batch rearm - #2352
Merged
threepointone merged 3 commits intoSep 24, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 00b2392 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
threepointone
added this pull request to stack #2357
September 24, 2026 01:08
Contributor
⚪ agents import sizesMeasured 344 runtime imports as minified bundles. The primary size is gzip; raw minified size is included for diagnosis. An existing import growing by more than 10% is marked red. This report is informational.
Compared No import sizes changed. All 344 current runtime imports
Reported by agent-think[bot]. |
threepointone
marked this pull request as ready for review
September 24, 2026 01:12
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
threepointone
force-pushed
the
fix/2185-approval-batch-rearm
branch
from
September 24, 2026 01:35
a12cfae to
6a04421
Compare
threepointone
force-pushed
the
fix/2185-approval-batch-rearm
branch
2 times, most recently
from
September 24, 2026 02:02
16ba35b to
9ac7a43
Compare
…#2171) A tool result or approval that arrives while a stream is active leaves an auto-continuation pending. If that stream then finishes with a normal assistant response (finishReason stop), firing the continuation replays a transcript ending in assistant text, which Anthropic rejects as prefill. Clear it instead; tool-calls and missing finish reasons keep re-arming. Co-authored-by: Colin McCullough <colin.mccullough@dutchie.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…nding A stream can finish with stop while a sibling tool call is still awaiting its result. Clearing the continuation then drops the batch's only auto-continue opt-in, so the later sibling result never continues the conversation. Only clear it when the batch is complete. Co-authored-by: Cursor <cursoragent@cursor.com>
threepointone
force-pushed
the
fix/2185-approval-batch-rearm
branch
from
September 24, 2026 07:03
9ac7a43 to
00b2392
Compare
Merged
threepointone
added a commit
that referenced
this pull request
Sep 27, 2026
* fix(think): submission and turn lifecycle edge cases - waitForSubmission throws in-turn / from onSubmissionStatus instead of deadlocking - cancelled running submissions emit terminal status once; controller registered before running hook - reset-skipped submissions visible to waiters only after their hook - activeChannel gated to the admitted turn - _lastTurnChannel set at inference start, cleared on reset - autoContinue:false mid-stream reject flushes deferred drop at finalize - dropGenerationAfterToolCall keeps later steps' text - regression tests, including ai-chat #2352 port and #2353 gaps Co-authored-by: Cursor <cursoragent@cursor.com> * fix(think): keep continuation channel when a turn fails before streaming Record _lastTurnChannel only after inference preparation (beforeTurn) succeeds and the stream starts, so a channel-less continuation does not route to a turn that never ran. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Sunil Pai <18808+threepointone@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Oct 5, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `@cloudflare/ai-chat` | 0.12.0 | 0.12.1 | patch | ## Release Notes <details> <summary><b>@<!---->cloudflare/ai-chat</b> (0.12.0 → 0.12.1)</summary> ### Patch Changes - [#2390](cloudflare/agents#2390) [`c55ec80`](cloudflare/agents@c55ec80) Thanks [@<!---->threepointone](https://github.com/threepointone)! - Report a failed agent-tool child as failed even when it was evicted before recording the failure. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md). - [#2384](cloudflare/agents#2384) [`f904999`](cloudflare/agents@f904999) Thanks [@<!---->threepointone](https://github.com/threepointone)! - Fix agent-tool chunks being duplicated or dropped on reconnect, child re-attach, and fiber recovery. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md). - [#2364](cloudflare/agents#2364) [`5e0507e`](cloudflare/agents@5e0507e) Thanks [@<!---->threepointone](https://github.com/threepointone)! - Add `eventDelivery: "terminal"` to `runAgentTool` to forward only lifecycle, progress, and milestone events for a run. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md). - [#2334](cloudflare/agents#2334) [`7f564e7`](cloudflare/agents@7f564e7) Thanks [@<!---->threepointone](https://github.com/threepointone)! - AI Chat and Think send the terminal `done` frame after persisting and broadcasting the assistant reply, so later sends are not overwritten. See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md). - [#2352](cloudflare/agents#2352) [`449ac27`](cloudflare/agents@449ac27) Thanks [@<!---->threepointone](https://github.com/threepointone)! - Do not start an automatic continuation after an …[full notes](https://github.com/cloudflare/agents/releases/tag/%40cloudflare/ai-chat%400.12.1) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
tombeckenham
added a commit
to tombeckenham/agents-tom
that referenced
this pull request
Oct 7, 2026
…gine Ports four upstream changes to the legacy AIChatAgent onto AGUIChatAgent: - cloudflare#2352: clear a stale auto-continuation when the active stream finishes with stop and the tool batch is complete (finishReason read from RUN_FINISHED via the accumulator). - cloudflare#2391: a tool call whose arguments complete after its approval request refreshes the persisted approval snapshot; the event-to-chunk projection re-sends the approval request after the late tool-input-available. - cloudflare#2392: settle an approved tool call that never ran once a new turn moves past it. The pre-turn repair now also runs on submitted turns. - cloudflare#2040: reconcile reused tool-call IDs one-to-one in the AG-UI reconciler (same-call claim, per-row result merge, stale-copy drop). Test plumbing: the legacy-wire WebSocket wrapper translated each frame once per listener through a stateful projector, so a second listener lost chunks. It now translates once per frame.
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.
Two commits:
mainin either Think or ai-chat. Tests covering that exact shape are added topackages/think/src/tests/client-tools.test.tsandpackages/ai-chat/src/tests/client-tools-continuation.test.ts, and both pass onmain. @abhagsain, if you still see the hang on the latest release, a reproduction against these tests would help.AIChatAgent. When the active stream finishes withfinishReason: "stop",_onStreamingTurnFinalizednow clears a pending continuation instead of re-arming a stale one. The finish reason is carried onStreamResultStatus. The new test fails without the fix.Co-authored with @ColinMcCullough, whose patch from #2171 this adapts.
Closes #2171
Refs #2185
Follow-up, not in this PR: Think's
_onStreamingTurnFinalizedre-arms the batch the same way, unconditionally. It has no reported symptom yet.