Repository navigation
Think on the harness: reply attachments to the turn's channel; a replayed turn's messenger context (C4, completes #3489) - #3493
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 ( |
…s the messenger context from the stored user message; the kept context is forgotten before anything in the end hook can throw
…lt and are posted to the turn's channel; deliverNotice defaults to the active turn's channel and messenger thread
…m its own turn's user message (rv-2)
…red-reply runs fail; the held reply is silent until its job; the lease test checks ActionPendingError; a mid-reply channel continuation successor that checks recovery continued
…ssenger turn's response hook; web attachment notices wait while the reply waits on a client; a turn's attachments survive the next turn's start; a replayed report reads its turn's path from storage; the compat total
…hen the running turn's messenger thread, then the responding context, as on Think; web attachment notices post whatever is pending, as on Think; no attachment snapshot that never took effect; a replayed report reads its turn's user message newest first, stopping at it; tests: a tool's and a response hook's notice land on the turn's thread
mattzcarey
marked this pull request as draft
November 28, 2026 13:01
mattzcarey
force-pushed
the
slim/deliveries-channels-c4-attachments-2
branch
from
November 28, 2026 13:01
20e8685 to
0d38f9c
Compare
mattzcarey
marked this pull request as ready for review
November 28, 2026 13:03
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.
Completes #3489. On the harness-backed Think, a turn's reply attachments are delivered to its channel as on Think, and a replayed turn's response hook keeps its messenger context. The upgrade tests' last fixture is now 0.24's exact recovery job.
Reply attachments, as on Think:
renderAttachment()is added (default:defaultAttachmentText).onChatResponse's result, and each one that renders is posted to the turn's channel first, as an interim notice.deliverNoticedefaults to the active turn's channel, and to its messenger thread while that turn or its response hook runs, as Think's_activeChannelId()does. Outside a turn, a messenger notice still names its thread. New tests: a tool in a messenger turn and a response hook each calldeliverNotice()with no channel, and the notice lands on the turn's thread, on both configs. The tool test fails on the shell at f641312._renderChannelAttachmentsdoes.attachment-consumptiongoes from 0 to 4/5; the fifth calls the class's private_renderChannelAttachments, so it's class-only with a new successor.actions-attach-replygoes from 0 to 11/12; the twelfth is a durable-pauseattachReply, which is harness'sactpause_area.Messenger context in response hooks (items owed from Think on the harness: messenger recovery, the messenger context, and channel continuations (C4 part 3, completes #3453) #3477's review):
Tests (Devin's notes on test(think): upgrade fixtures as [email protected] wrote them; a mid-reply channel continuation successor (completes #3484) #3489):
waitingon itsbackoffsleep, with the step journaled.channel-recoverysuccessor checks that recovery continued the reply (recoveryKind: "continue").Cost: nothing on an ordinary turn. One
deliverNoticeper rendered attachment, as on Think. On a messenger agent's replayed terminal report, the stored path read back to the turn's user message (a transcript sync when the reply isn't stored).Not covered: there's no test for the replayed-report window, since it needs a reset between a saved reply and its report.
Tests ran on both configs:
attachment-consumption,actions-attach-reply, the upgrade files,channel-recovery,messengers(shell 123/131, the 8 class-only),deliver-notice,messenger-replay, plushooksandthink-session's response and messenger tests, with none lost against main. The compat table was regenerated before the last push (the two new tests pass on both configs and aren't in it yet): 720 of 1357 (87 class-only, 10 of them mechanics-only, 6 ruled out, the rest each with a successor).Left as on Think: a turn's attachments are one list per agent, so a turn that begins before the previous turn's end hook reads them replaces them (the class does the same).