Repository navigation
harness-backed Think: the view follows the session's change feed; streamed tool calls count before they're stored (harness score K, J) - #3476
Merged
Conversation
|
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Contributor
|
✅ agents import sizes: no significant changes ( |
mattzcarey
marked this pull request as draft
November 27, 2026 13:08
…ed, as Think's does, so a write made straight to the session reaches media eviction
…ed, as Think's accumulator does; one successor
…urn's end re-windows it, one re-read per compaction; the answerable set is built once per check
mattzcarey
force-pushed
the
slim/harness-score-KJ
branch
from
November 27, 2026 13:20
b1b1316 to
298dd59
Compare
mattzcarey
marked this pull request as ready for review
November 27, 2026 13:30
mattzcarey
marked this pull request as draft
November 27, 2026 13:41
…eping, best-effort, so a failed read never skips the cleanup or onChatResponse
mattzcarey
marked this pull request as ready for review
November 27, 2026 13:54
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.
Harness score, groups K and J: the rest that harness consented to (10:08), as one PR with one commit per change.
1. J: the shell's view follows the root session's change feed
As Think's does, the shell's transcript view now follows the root session's
mirrorwith Think's rules:rowChangedOutsideCache);The harness also forwards writes made straight to the session as
messageevents, so theharness.observehandler no longer applies messages. It wakes the stable waiters, and it still re-syncs on reset and transcript. Before, an update to a row hidden under a compaction was treated as an append at the leaf.c1is hidden under a compaction and given an image by an update made straight to the session. It fails without the mirror. The old test, which drives the private seam, becomes class-only with this successor.2. K: a reply's streamed tool calls count before it is stored
As Think's in-flight accumulator does: the shell tracks each running operation's streamed tool calls from
onChunk(tool-input-available, an approval request, and the output that settles them) and drops them at the turn's end.hasPendingInteraction()counts them as it counts stored ones.hasPendingInteraction()is true mid-stream. "detects a pending CLIENT-tool interaction living ONLY in the in-flight accumulator" becomes class-only with it.3. The view's bookkeeping as Think's (rv-4, Devin)
HYDRATION_MESSAGE_OVERHEAD_BYTES, and an update that grew chargesnoteGrowthand invalidates the cursor, as_noteCachedReplacementdoes. The constant moves intotranscript-cache.tsand both Thinks import it.refreshIfNeeded), as Think's does after a chat request. Before, nothing trimmed a view that browser chats grew, since the observer no longer re-reads.hasPendingInteraction()check.Score (
vitest.harness.config.ts, against main):think-session (131) and hooks (121) are unchanged. Class suites: media-eviction 32/32, client-tools 144/144.
Cost: the mirror is the subscription Think already has, with no extra statement. Live calls are one in-memory map per running operation.
Shell lines: the observer block and a new mirror subscription in onStart;
onChunkandonTurnEnd(one line each);#liveCallsand#noteLiveCall;hasPendingInteraction.