docs(adr): chatting with a connected agent — session/prompt over /acp (Part C) - #47
Merged
Conversation
… (Part C) Part B made Studio publish its `oab` tools to the agent (reverse MCP); the remote connection works but the operator still can't talk to the agent — `session/update` chat frames arrive on the live socket and are dropped. This ADR proposes the chat panel: additive on the same `/acp` session (session/prompt + streamed session/update + session/cancel), with a three-layer design (acp-tunnel builders + typed AgentChunk; remote.rs mpsc write-handle + tokio::select! + emit agent-update + id-correlated pendingReqs; console chat panel) and a UX parity target lifted from the working `brettchien/katashiro` client on the same gateway. MVP scope: single bound agent, text single-turn streaming, stop/retry, batched queue, markdown-at-finalize, autoscroll. Multi-agent room, tool-call cards, history/resume deferred. Open questions flag the facade routing + session/update taxonomy for server-side confirmation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Multi-agent room / @mention / relay / loop-guard is not a goal (Brett, 2026-08-14). Studio chats exactly one remote.toml-bound agent; the room machinery is left behind, not deferred. Removes it from parity target, scope, and open questions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brett: history + session/resume are needed -> moved from deferred into MVP scope (persist sessionId in the Rust core, resume-then-new handshake, transcript restored before connect). Accessibility dropped, but recorded with the correct rationale (single-operator internal tool, not 'because it's native' — a11y is a webview concern that would otherwise apply). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… streaming Jellyfish's live server-side eval (against Orca /acp) established: (1) session/prompt routes to the bound agent and runs tools, returns stopReason:end_turn — Part B viable; (2) openab emits ONLY a single terminal agent_message_chunk (~5.5s silence then one ~329-char chunk), zero tool_call/thought — so token-streaming and tool-call cards are upstream-blocked, not Studio slices; (3) the mpsc+select!+pendingReqs id-correlation refactor is sound. Rewrites the 'streaming' premise across the ADR: reply rendering is single-shot behind a think-spinner, keeping an accumulate-then-render shape as forward-compat if openab later streams; stop = abandon the turn (no partial in single-shot); §7 splits resolved-by-review from still-open (session/resume server-side, persistence store, Tauri threat model). Part B backend skeleton can start (streaming-independent). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resume is honoured and preserves agent memory across reconnect
(codeword recall verified). Two implementation requirements folded into
§3: resume params must be {sessionId, cwd, mcpServers} (sessionId-only
fails -32602 missing cwd), and oab mcpServers must be re-declared so the
reverse-MCP tunnel re-attaches on the resumed session (else the agent
keeps memory but loses Studio's oab tools). §7 moves session/resume from
still-open to resolved-by-review.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…el re-attach) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nlit impl Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
ADR for review (per Brett: ADR-first, then Jellyfish review). Goal: give OAB Studio a chat panel that reaches parity with katashiro's chat experience, on the same live
/acpsession Part B already opens.What this proposes
session/prompt({sessionId, prompt:[{type:"text",text}]}→{stopReason}) + streamedsession/update/agent_message_chunk+ one-waysession/cancel. Wire contract copied from katashiro (working client, same gateway).acp-tunnel: prompt/cancel builders + classifysession/updateintoInbound::AgentChunk.remote.rs:RemoteStategains anmpscwrite-handle,run_onceselect!s prompt-out against read-in, theInbound::Otherdrop site becomesapp.emit("agent-update"), prompt responses are id-correlated (pendingReqs), and the handshake resumes a persistedsessionId(falling back tosession/new).consolepanel/tab; UX parity from katashiro's chat (two-phase render: plain-text streaming → markdown-once-at-finalize; markdown-it+DOMPurify+hljs+copy; stop/retry; batched queue; stick-to-bottom + jump pill; persistent transcript restored before connect;agent_prompt/agent_cancelcommands).Scope
session/resume.session/updatekinds; browser-tunnel status strip.Review asks for Jellyfish
session/promptto the bound agent (Orca) and streamsession/updateback? You have the server + key to confirm before Part B lands.session/updatetaxonomy (open q feat: studio control-plane — agent-lifecycle + vendored oabctl + MCP (slice-0) #2) — what update kinds does the openab agent emit beyondagent_message_chunk(thoughts,tool_call/tool_call_update)? Shapes the phase-2 card model.remote.rsbidirectional refactor (mpsc + select! + id-correlation + resume) against the openab/acpserver's actual behaviour — especially whethersession/resumeis honoured server-side.Reference:
brettchien/katashiro.🤖 Generated with Claude Code