Repository navigation
feat(web): reply to an assistant response from its hover actions - #33124
Merged
Merged
Conversation
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.
With many subagents, a thread fills up with similar-looking responses, and there was no way to say which one a message is about.
Reply. Assistant responses get a reply button on hover, next to copy and fork. It puts a "Replying to" bar above the composer and focuses it. The bar names the subagent the response was about, when there was one, and shows how the response starts. Clicking that text jumps to the response, and the x cancels the reply. The reply is saved with the draft, so it survives thread switches and reloads.
What the agent reads. A reply is a new
responsecontext record on the message, next to the existing thread, terminal and review-comment records. It carries the response's ids, its first 300 characters, and the subagent's name and thread. It does not carry the response text. The server projects it for the provider like the other records:The agent usually still has the response in context, so the opening is enough to find it. After a compaction or a provider switch it reads the response with the call in the record. A reply costs under 1,000 characters however long the response is.
Bench. I ran five scripted threads through Claude Opus 5.5 at low, medium and high effort, one run per format and effort (so 3 runs per cell). Each thread has six similar subagent write-ups. T1 and T2 ask about an older write-up, T3 and T4 ask after a compaction, and T5 is a control that replies to the latest response.
Without a reference the agent picked the wrong response every time and said it was sure. The pointer matched the full copy on accuracy at under half the size here (about 850 against 1,900 characters), and the gap grows with longer responses. The cost is one tool call when the response has left the context. This is a small scripted bench, not a run through the repo's eval harness.
Simulation on real threads. I then replayed 8 real threads, each with six subagent write-ups, and replied to one that was 2 to 4 write-ups back. Two of the threads have another write-up that opens with the same 64 characters. A blind Opus 5.5 judge decided which write-up each answer described. One run per cell.
Without the opening, sol reads the response again to be sure, which costs about 3,400 tokens to save about 100. So the block keeps the opening. Its first sentence is shorter than in the bench above, and the read call no longer carries the environment id, which
t3_thread_readtakes as optional. After a compaction every run made the read call and answered about the right write-up.Sent replies. A sent reply renders as the card #34181 added for quotes, inside the bubble, above the text. It shows the subagent, when there was one, and the opening of the response. Clicking it jumps to the response and highlights its opening. Copying the message, or only the card, copies the reply reference once.
Needs a contract approval.
packages/contracts/src/composerContext.tsgains theresponserecord kind. Nothing else on the wire changes, and no server code changes: the provider text comes from the shared projection the server already calls./siderefuses a message with a pending reply./clearsent as text is a message. Picking/clearfrom the slash menu still arms a fresh session and keeps the reply for the next message, as it does today with attachments.Verified in the dev app with a Replay thread on the final code: hover shows the button, clicking shows the bar and focuses the composer, the bar survives a reload, and the x clears it. Sending renders the card and clears the bar, for a normal send and for a message steered into a running turn. The server stored the
responserecord, and projecting that stored message gives the text above. Reading a thread by item id returns that one item. Clicking a card jumps to the response and highlights its opening. A reply with an image still renders as below.The subagent lookup was checked on a copy of a real thread with five completion notices: after a cold open, and after loading earlier turns, each response that followed a notice named that notice's subagent, and responses that followed a PR or command notice named none. The subagent screenshots below come from a real Codex thread (gpt-6-luna) that delegated one task: the completion notice named the subagent, the reply carried it, and the model answered the reply about that review.
Not exercised in the app: a task delegated to a linked environment, a completion steered into a running turn, a failed send, stash and restore, and mobile. The provider input was checked by projecting the stored message, not by capturing an adapter call.
On the current head, merged with main: format, lint, typecheck in contracts, shared, client-runtime, web, mobile and server, the unused-export check, and 241 unit tests in the 7 test files beside the change pass. In the dev app, one merge of main earlier, I replied to a response and sent it, steered a reply into a running turn, and queued a reply behind two other messages. Editing the queued reply showed the reply above the composer and only the typed text in it. Saving kept one reference, and the message then sent with one card and one stored
responserecord:After an earlier merge of main, which brought in the quote cards from #34181, in the dev app I replied to a response and sent it: the bar showed, the card rendered, the bar cleared and the Replay turn ran. An earlier reply about a subagent still shows its title. Copying the whole message and copying only the card each gave the reply reference once. Quote cards still render.
Hover actions before:
Hover actions after:
The reply bar, and the same bar for a response that reported on a subagent:
A sent reply:
A sent reply about a subagent, light and dark:
A reply with an image:
Done by Claude Opus 5.5 and Claude Fable 5.2 in Claude Code.
🤖 Generated with Claude Code
Both verdicts are for ad06093. The head after it adds one merge of main with no conflicts.
Reviewed with sol-loop: 11 rounds with gpt-6.1-sol at high. Verdicts: approved, approved.