Repository navigation
Chat: no deferred continuation slot (4.ii-a, slice 2) - #3240
Open
mattzcarey wants to merge 6 commits into
Open
mattzcarey wants to merge 6 commits into
mattzcarey wants to merge 6 commits into
Conversation
|
| Name | Type |
|---|---|
| agents | Patch |
| @cloudflare/ai-chat | Patch |
| @cloudflare/think | Patch |
| @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
mattzcarey
force-pushed
the
slim/chat-fn-2b
branch
from
November 26, 2026 05:38
a56453c to
dd8e917
Compare
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Contributor
🟢 agents import sizes: 1 entry point changed, no growth
Changed exports (1)
How this worksEach runtime export is bundled on its own, minified, and gzipped. Changes smaller than 100 B, or smaller than 1% and 1 KiB, are ignored. Growth over 10% or 5 KiB is marked 🔴. This report is informational and does not fail CI. The workflow artifact contains every measurement. Compared |
mattzcarey
force-pushed
the
slim/chat-fn-2b
branch
from
November 26, 2026 06:43
dd8e917 to
d742efb
Compare
mattzcarey
marked this pull request as ready for review
November 26, 2026 07:05
…nuation schedules the next one, behind it in the lane (4.ii-a, slice 2)
…tles; a tab's stop is for the reply it was told to resume
… a held result at every continuation settle
… Think answer then a reset across the coalesce window
…tab; the gate assertion no longer hides in the model
mattzcarey
force-pushed
the
slim/chat-fn-2b
branch
from
November 26, 2026 07:40
cb6074d to
f49f70c
Compare
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.
Chat functions step 4.ii-a, slice 2 (slice 1 was #3239). The deferred continuation slot is gone. When a tool answer arrives while a continuation runs, it now schedules the next continuation like any other answer: it coalesces, and the barrier holds it until the running continuation has streamed and its reply is finalized (or the running one settles without a stream), because the model may still add tool calls to the reply it answers. Its turn then waits behind the running one in the lane.
ChatTurnskeeps the newContinuationSlots(pending: scheduled, its turn not started;running: its turn started, its stream not;activeRequestId: its stream runs; and the tabs waiting) instead ofContinuationState, and these go with the slot:deferred,pastCoalesce,activateDeferred, the settle step that merged a deferred answer's targets into a newer continuation, and the stop branch that dropped a deferred answer.What changes for an app: an answer that arrived during a continuation now starts its follow-up one coalesce window (50 ms) after the reply is finalized, not at once when the turn settles. A stop that drops it reports it under its own request id (
cont-2:stopped), where it used to berequestId: null. The rules in continuation-turn.ts still hold, and each test that covered the deferred slot now covers the next-continuation path: one continuation per result, never against a transcript that ends in an answer, an answer during a run is never lost, a waiting tab always getsSTREAM_RESUMINGorSTREAM_RESUME_NONE(a tab whose answer arrives during a run starts waiting once that run's stream starts or its turn ends), and a stop drops what waits. A tab's stop without an id is for the reply it was just told to resume, even when that tab already waits on the next continuation.ContinuationStatestays exported, unchanged and@deprecated, because released ai-chat 0.12.3 and Think 0.24.0 construct it and hand it to thisResumeHandshake. The handshake readsrunningas optional for that reason, and a test checks it still parks a tab on such a host's pending continuation. Next is slice 3: the stored continuation keys.Cost: deferred slot code deleted from continuation-turn.ts and chat-turns.ts;
ContinuationSlotsadded (≈90 lines with docs); the deprecatedContinuationStateis still there for released imports. Interfaces:ContinuationTurnPartslosesactivateDeferred.