Repository navigation
Conversation
PR #989: Connect ACP clients to a live REPL Sidekick29 files, +3590 / -188 Scope🔴 PR has 3778 lines changed. Split into focused PRs. 🟡 3778 lines changed. PRs under 400 receive more thorough review. 🟡 29 files changed. Are all changes related? 🟡 PR mixes config and source changes. Structural🟡 3 console statements. Oxlint structural signals:
SlopOxlint slop signals:
Static AnalysisOxlint: 178 diagnostics across 13 files (20 rules) no-shadow (71): packages/cli/src/repl/sidekick/history.ts, packages/cli/src/repl/sidekick/dispatch.ts, packages/cli/src/repl/sidekick/model.ts (+5) CorrectnessNo extraneous code patterns detected. |
Why
Connect an ACP client to the Sidekick already held by a live REPL, so it can send a text request and inspect the resulting public activity and entry evidence.
This is a dependent draft on #988. Its initial head is
806dc51cde6b9ad32b63cfaeeb8f39a17fea786e; the selected parent branch isagent/testagent-model-options-984-deliveryatd9c43800b491271a1ad07f9cda24caa66ea8c830.What changes
Before: the REPL's Sidekick has no external ACP attachment or passive command-line read path.
After: start or resume a REPL with an established selected Sidekick conversation and opt in to a private attachment file. Use an existing owner-controlled parent directory:
xmd repl 'xmd://repl/<execution>/entries' --sidekick-acp /absolute/private/attachment.jsonConfigure an ACP client to launch this stdio backend:
A separate command can read current public status without sending a prompt:
xmd sidekick read --attach /absolute/private/attachment.json statusMessage reads can follow an acknowledged message reference; entry reads return bounded Source, Prompt, Output or Journal pages. The attachment creates no underlying conversation and keeps the selected provider and permissions.
How it works
The opt-in endpoint uses a same-user POSIX Unix socket and a private descriptor bound to the live owner, execution, conversation and cwd. Strict requests and bounded observer queues keep malformed or slow clients from blocking the producer.
Disconnect detaches observation while the REPL continues its exchange. Explicit ACP cancel/close captures and joins only that attachment's exchange. Busy work refuses before a message is saved. External messages retain origin and an acknowledged opaque ID without clearing the human's composer or taking over a held draft.
Review guide
Start with
specs/repl-spec.md, “Attaching to the live Sidekick”.Then review:
packages/cli/src/repl/sidekick/dispatch.tsand its application integration for shared admission and producer ownership.packages/cli/src/sidekick-acp/for descriptor identity, bridge mappings, safe reads and exact cancellation.repl-sidekick-acp.test.tsandrepl-sidekick-dispatch.test.tsfor the attachment and shared-dispatch regressions.Look carefully at completed-load replay, disconnect versus cancellation, replaced-file cleanup, and a failed follow-up after an earlier answer.
What must stay true
end_turncannot establish a missing completion.The dispatch, attachment, lifecycle, control and repository regression coverage checks these boundaries.
How to verify it
Recorded focused evidence passed on the candidate whose complete source corresponds to this exact head: the eight-file attachment/help/boundary/lifecycle/control/observation/repository/Session-configuration selection reported 39 tests, 186 steps, zero failures, with two real-child summaries of one test and six steps each.
The controlled integration exercises the released ACPX 0.12.0 CLI and XMD's distinct patched provider/runtime, including serial requests, passive reconnect/load, cancellation and incomplete-result controls. The first selection exposed an A6 fixture teardown failure; the correction drains the real event iterator before closing the runtime. The first failure remains retained. A temporary-file collision is a scheduling inference, not an instrumented interleaving.
Both original independent source reviewers passed this exact head. One committed
deno task verify:cleanpassed on it; that proves dependency ownership and non-interference, separately from product correctness.These are recorded local results on Darwin arm64/Deno 2.9.7, not final CI results or a live operator Sidekick recovery trial. No tests were rerun to prepare this description.
Scope
Included: shared Sidekick dispatch, opt-in local ACP text/load/close support, passive status/message/entry reads, runtime adapter installation, and the associated help, specifications and regressions.
Deferred scope includes queueing, coediting, cross-client question answers, live relationship recovery, remote hosting and repository-wide ACP. The current
--observe-worktreespelling remains unchanged; its separate naming proposal has no human approval.Refs #961, #963.
New abstractions and dependencies
The private dispatch handle serves UI Send and ACP while keeping the producer under the REPL root. The private transport supports the ACP bridge and passive CLI reader without exposing the execution controller.
The CLI declares its direct
@agentclientprotocol/sdk@1.3.0import for the stdio bridge, using the already selected SDK version.deno.lockrecords that real dependency edge. ACPX and vendor bytes are unchanged; no generated browser or vendor output is added.Risks and remaining delivery gates
This remains a draft. Combined-source runner measurement and authentic artifact/weight integration are pending delivery work; this description claims no run ID, outcome or consumed artifact. Existing d9 measurements and CI retain their own commit provenance.
Required CI must prove the actual final published head and current main. Any resulting weight or integration commit needs affected evidence correspondence and both original final-head reviews. Final Planner metadata APPLY and independent VERIFY remain outstanding after the configured CI and artifact gates.
The endpoint is POSIX-only and requires an established selected conversation. Switching conversations invalidates the attachment. Controlled client evidence does not resolve the held live Sidekick's unknown feedback acceptance.
Scope confirmation