Repository navigation
feat(acp): show the claude surfaces on shared-runtime chats - #37586
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the #37512 readers are reused through one wrapper around the handle's parser, each reader checks its backend set and the session id first, and the renamed [DESIGN-REVIEWED] cacf908 Description read[DESCRIPTION-READ] a9b055c1187289afe4b024b9a64dfa50b6174b83c35265bbd6002a42adb06fef That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: every surface reuses the #37512 readers, each one is limited to its own Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: a claude chat on the shared ACP runtime shows the same adapter rows a per-chat claude process shows, each only in its own chat — ADDITION.
[FIRST-PRINCIPLES-REVIEWED] cacf908 Description read[DESCRIPTION-READ] 951e7fd79f0519bb997f279acee18e05d3dd0cb7c61e067d4a0e6b21bf1be24c That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. The PR wraps the shared handle's session/update parser so a claude chat on the shared runtime gets the per-chat client's surfaces (#37512): adapter notices, mode-change notices, the plan checklist, the Read preview argument and compaction summaries. It reuses the existing readers, each gated on its own An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
f3843ff to
7f42776
Compare
7f42776 to
a78c459
Compare
A claude chat on the shared runtime reads its frames through AcpSessionHandle, which had none of the claude-agent-acp surfaces the per-chat AcpClient shows. The handle's _handle_update now wraps the frame parser (renamed _handle_update_frame) with the same readers, for this session's own frames only: - an adapter notice becomes its reply text with the notice attached; - a mode change and a plan's checklist are events before the frame's; - a read tool call names the argument the row previews; - a native compaction's streamed summary is kept off the turn's text and titles the completed card. The handle gains the fields those readers take (backend, _acp_config_options, the mode names noted at session start, and its own CompactionSummaries). Tests run two chats on one runtime through the real reader loop and check each surface reaches only its own chat; thinking and the Fast mode switch are covered the same way.
a78c459 to
cacf908
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked the diff on this head (one commit on top of current main) along with the shared-handle code it touches. The new wrapper reuses the existing claude surface readers, and each reader still checks its own claude-only backend set and its own session. Kiro, KAS and codex frames come out unchanged. The new two-chat tests pass (6 of 6) in a serial run. Pointing _handle_update back at the bare parser makes the first four fail, exactly as the body says. Each mutated production line we tried reds a test. Done well: the per-chat readers are reused through one wrapper instead of copied, and the tests drive real frames through the runtime's reader loop with two chats on one process.
Optional:
docs/system-specs/modules/acp-client.mdhas no owner-table row foracp/session_handle_harness_surfaces.py, and three passages still name_handle_updateas the parser.client_usage.py:268still says the handle's twin reads no summary. A follow-up could fix all four._fold_compaction_summarydecides the compaction outcome a second time, after parsing. If the forget and completed-summary calls moved into the handle's compaction twin, the same wayclient_usage.pydoes it, the wrapper would be gone and the repeated-start forget difference with it.- A two-chat case where chat B gets frames of its own would pin the session guard at line 54 and the per-handle
CompactionSummaries. Today both survive mutation, because the runtime's routing already keeps B's frames away.
Problem / Motivation
Goal: a claude chat on the shared ACP runtime shows the same claude-agent-acp notices, mode changes, checklist, Read previews and compaction summaries as a chat on its own process, each only in its own chat.
#37512 added these surfaces to the per-chat
AcpClientreaders (client_turn,client_tool_events). A chat on the shared runtime reads its frames throughAcpSessionHandle, which calls none of them, so once claude chats can share one process (#37540) those chats would lose the adapter's rate-limit and retry notices, the mode-change line, the plan checklist, the Read image preview and the summary on the compaction card.Stack: this branch carries #37521 (ClaudeHarness, not routed) underneath one commit of its own. It merges after #37521 and is rebased to one commit then; review only the top commit. #37540 and #37563 stack on top of it.
Why it matters
Without this, turning on claude chat sharing silently drops display rows the user sees today on a per-chat claude process. With several chats on one adapter, each of these rows must also land in the chat whose session sent it and in no other.
Not a goal
ACP_BACKENDS_SESSION_SHARING, so a claude chat's subagents keep their own process, whereCardToolTitlesalready applies.ACP_BACKENDS_*set first.What changed (motivation -> approach -> change)
The handle should show what the per-chat client shows -> reuse the #37512 readers instead of copying them -> one wrapper around the handle's frame parser calls them for this session's own frames.
acp/session_handle_harness_surfaces.py.AcpSessionHandle._handle_updateis now its_handle_update, which wraps the parser (renamedsession_handle_updates._handle_update_frame). For a frame naming this session it:noticeinto a text chunk withharness_noticeattached (harness_notices.adapter_notice);compaction_summary.note_chunk) and titles thecompletedcard with the summary;plan_checklist.todo_event) and the mode-change notice (harness_notices.mode_notice_event) before the frame's own events;read_path_argon Read tool events.A frame of another session, or of a backend outside the sets, goes to the parser unchanged.
backendproperty (the runtime's backend id),_acp_config_options(the stored config options), the mode names and last mode report (_harness_mode_names,_harness_mode, written by the readers), and its ownCompactionSummaries.store_session_confignotes the session's mode names (harness_notices.note_session_modes), as the client does onsession/new.fastfrom the session provider'sacp_config_options. They get the same two-chat tests.test_session_handle_bindingsinventory andtest_harness_parity's identity declaration follow the rename.Backwards compatibility
Compatible: the readers act only for a backend in their
ACP_BACKENDS_*set, and only claude is in them; no claude chat takes the shared runtime until #37540's switch is on.Removes nothing:
_handle_updatekeeps its name and signature on the handle; the parser it wrapped is renamed_handle_update_frameand has no other caller.Tests
test/test_claude_shared_surfaces.py: two claude chats on one runtime, frames written to the runtime's stdout and read by its real reader loop. Each test sends chat A's frame and checks A's turn shows the surface and B's turn shows none of it:With
_handle_updatepointed back at the bare parser, the first four fail; the last two are routed by the runtime and pass either way.Proof: not provable -- other: feature PR, the mutation above is the check
Also run, serially:
test_session_handle_bindings,test_harness_parity,test_runtime_bindings,test_acp_runtime,test_claude_shared_runtime,test_security_posture, and every test file that calls_handle_updateor the #37512 readers (all pass).Manual verification
N/A for this PR alone: no chat reaches this path until #37540's switch is on. The pod check of #37563 (the top of the stack) looks at each surface on a shared chat.
Related Issues
Follows #37512. Part of the claude chat sharing stack: #37521, this PR, #37540, #37563.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.