Repository navigation
harness-backed Think onto the shared chat dispatch (H2c) - #3488
Draft
mattzcarey wants to merge 4 commits into
Draft
mattzcarey wants to merge 4 commits into
mattzcarey wants to merge 4 commits into
Conversation
The chat module's functions over Tasks, Streams, Sessions and WebSockets: chatDispatch, submitTurn, answerTool, cancelTurn, clearChat, resumeChat, replayTurn, and the chat-turn definition's parked tabs, live turns and stopped mark. Rebased onto main c519393 from e44a940; the one conflict (the turn's report) keeps main's stash drop and 6d's continuation and parked-tab steps.
…o main as one commit AIChatAgent runs its turns on chatTurnDefinition and chatDispatch, and its old engine is deleted. Rebased onto the rebased #3298 from f87cd85 plus verify's FIX: main merged in (#3389, #3444, #3447, #3435, #3423 resolved in chat-host.ts with turn-task's notes), F27, the stop in a retry backoff ending the turn once, a throwing onChatRecovery given up with recovery_error, and turn-task's 25baf34.
|
| 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-6s1
branch
from
November 27, 2026 16:31
284ae7a to
cbc1aad
Compare
A tab's frames go through chatDispatch over ThinkHarness.chatDeps/chatLane; turns frame their own replies; a connecting tab is offered a stream through resumeChat; ThinkChat keeps the transcript, clear and connect frames. A dispatch run is the harness's own operation (messages, regenerate, continue), its session read from its input; a tab's list is reconciled against the stored transcript; a tab's client tools have one store (the request's, then the chat's request context; a clear drops them); a stop of a started turn goes to the harness's keeper; the shell takes messageConcurrency.
…blic successors); four pass on H2c and their rows are class-only, four wait for harness's reconciler
mattzcarey
force-pushed
the
slim/harness-h2c
branch
from
November 27, 2026 16:52
9359ed0 to
68cedb1
Compare
mattzcarey
force-pushed
the
slim/chat-fn-6s1
branch
from
November 27, 2026 16:54
cbc1aad to
1197fa3
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.
The harness-backed Think takes a tab's chat frames through the shared chat dispatch (
chatDispatchoverThinkHarness.chatDeps/chatLane), the same path AIChatAgent uses after #3361. Its turns frame their own replies. A connecting tab is offered a turn's stream throughresumeChat. ThinkChat stays only for the transcript, clear and connect frames, and is unchanged for bare ThinkHarness hosts.H2c of the Think closeout: the two Thinks get one chat protocol.
ChatTurnInputbecomes the harness's own operation: messages, regenerate, continue. A tab's copy of a stored message doesn't replace it.messageConcurrency,waitUntilStableandhasPendingInteraction, andonChatResponsereportscontinuation.Tests ran:
harness-think(agents), and Think's suite on both configs. harness-compat is regenerated: 317 of 1296 on the harness config, against the 294 the switch's file records. The four rows not passing also fail on the switch's head.Cost: a dispatch run's placement reads the chat's request context once and writes the session's client tools once. A turn reads its host's sockets per frame, and serializes nothing when no tab is connected. ThinkChat's broadcasts go through a per-connection proxy that drops the frames turns send themselves. No new rows, tables or KV keys.