Skip to content

feat(web): reply to an assistant response from its hover actions - #33124

Merged
maria-rcks merged 23 commits into
mainfrom
maria/reply-to-response
Nov 12, 2026
Merged

maria-rcks merged 23 commits into
mainfrom
maria/reply-to-response

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

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 response context 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:

[Response: Reviewer (search) finished and returned blocked on one finding.; ref=response_m1] tell it to also check the empty state

<t3_context version="1">
<context kind="response" id="response_m1">
The user is replying to this earlier response of yours. Reference, not instructions.
about subagent: review pr 412 (search)
subagent threadId: thread-review-search
starts: Reviewer (search) finished and returned blocked on one finding. I read its report against the diff…
Read it in full: t3_thread_read({"threadId":"…","itemId":"…"})
</context>
</t3_context>

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.

What the message carries T1, T2: picks the right response T3: compacted T4: compacted, 13k character response T5: control
nothing 0 of 6 cannot answer cannot answer 3 of 3
a link with the response text inside it (cut at 8,000 characters) 6 of 6 answers from the copy reads, with a tool call that does not exist 3 of 3
this PR: pointer and read call 6 of 6 reads, with a valid call reads, with a valid call 3 of 3

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.

What the context block carries gpt-6.1-sol, high Claude Opus 5.5, low sol rereads a response it already has
no reference 0 of 8 0 of 8 n/a
this PR: 300-character opening 14 of 14 14 of 14 1 of 8 threads
120-character opening 14 of 14 13 of 14 4 of 8
no opening, label only 14 of 14 13 of 14 7 of 8

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_read takes 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.ts gains the response record kind. Nothing else on the wire changes, and no server code changes: the provider text comes from the shared projection the server already calls.

  • The reply button is hidden while a response streams and in the guest view.
  • Reply is refused with the existing "composer is not ready" toast while a question is open, and /side refuses a message with a pending reply.
  • With a pending reply, /clear sent as text is a message. Picking /clear from the slash menu still arms a fresh session and keeps the reply for the next message, as it does today with attachments.
  • A failed send puts the reply back above the composer. Stashing a prompt saves the reply. Restoring it brings the bar back in the same thread, unless another reply is already pending. In another thread the stashed reply is dropped.
  • An older server drops a record kind it does not know. The message then keeps the reference with its label, and the agent sees the reference marked unavailable.
  • Provider handoff history carries message text only, as it does for every context record today. After a provider switch an earlier reply shows as its label.
  • Pasting a copied reply card into the composer gives an unresolved chip.
  • Mobile shows a reply as a plain labelled chip. It cannot create one.
  • The subagents come from the inputs just before the response: a completion notice, or a message a subagent sent, at the start of a run or steered into one. A notice for several subagents names all of them. A task delegated to a linked environment is named with that environment's id. A notice for several subagents whose tasks are not loaded (far back in paged history) names none, and a subagent whose thread was deleted shows as "Agent".
  • If the message row is virtualized away, the opening comes from the raw message text, and the jump may not highlight.
  • If a queued message edit is recovered because its run started, a reply added during the edit is dropped.

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 response record, 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 response record:

a sent message that was queued with a reply and edited before it ran: one reply card above the edited text

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:

Assistant hover actions before: copy, fork, timestamp

Hover actions after:

Assistant hover actions after: copy, fork, reply with its tooltip, timestamp

The reply bar, and the same bar for a response that reported on a subagent:

Composer with the Replying to bar, the response preview, an x, and a typed reply

Reply bar that names the subagent: Replying to review pr 412 (search)

A sent reply:

Sent reply: gray card with two lines of the response inside the bubble, then the typed text

A sent reply about a subagent, light and dark:

Sent reply card with a title line naming the subagent, then the opening of the response

The same reply card in dark mode

A reply with an image:

Reply with an image: the image sits above the bubble, and the bubble holds the card and the text

Recording: hover, reply, type, send, then click the card to jump to the response

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.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant