Repository navigation
acp: list, fork and close sessions where the agent advertises them - #170
Merged
Merged
Conversation
read sessionCapabilities.list/fork/close at initialize and send session/list, session/fork and session/close only when advertised. the harness maps listings to the session browser page, opens forks at the end of a session (no fork point in acp), and closes on release so the agent lets go (native release). the isolated harness refuses unadvertised list and fork before launching a process and hides its picker probes from listings. enables the vendored crate's unstable_session_fork feature; no vendored source change.
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.
Wire change (provider-facing ACP)
session/list,session/fork,session/close.agentCapabilities.sessionCapabilities.list,.fork,.close, read once from theinitializeresponse.agent-client-protocol2.0.0 / schema 1.5.0. Fork turns on the vendored crate's existingunstable_session_forkcargo feature incrates/agent-driver-acp/Cargo.toml.INLINE-PATCHES.mdis unchanged and the 1 MiB frame limit stays.listreturns an empty page, a missingforkreturnsOpenError::Unavailable, and a missingclosekeeps today's release (Unsubscribed). The driver'slist_sessions/fork_session/close_sessionalso fail closed withUnsupportedif the method was not advertised.IsolatedAcpHarness(the CLI's ACP route) refuses an unadvertised list or fork before launching any agent process.Who gets it
list,fork,close(plusdelete,resume). OpenCode builds that still take the ACP route gain all three. Newer OpenCode builds use the native OpenCode harness.0.8.1+e4ccce1.inline3) only advertisesloadSession. No change.Behaviour
session/listontoSessionPage. Unusable session ids and blank titles are dropped,updatedAt(ISO 8601) becomes Unix seconds, and the agent's cursor carries over. The isolated harness lists through its tool-free settings probe (or a short-lived tool-free process) and hides its own probe sessions. Nothing in the v2 CLI callsHarnessDriver::sessionsyet (for any harness), so listing is ready for a future v2 browser.OpenMode::Fork { at: None }sendssession/fork. A missing source maps toOpenError::NotFound. ACP has no fork point, soat: Some(..)returnsUnavailable: "Fork here" works, andspawn_threadforks (which pass the lead's last finished turn) already fall back to a fresh start from the brief. A fork's first turn re-sends the thread's guide (new thread), unlike resume.release()sendssession/closewhen advertised. On success it returnsNativeReleased, cancels that session's pending approvals and questions, and drops it from the settings catalog map. On failure, after a 2 s close timeout, or when not advertised it returnsUnsubscribed, as before. A stalled close never ends the connection or holds the chat's worker. In the isolated harness the private process is still stopped afterwards.AcpHarnessnow holds the concreteAcpDriverinstead ofdyn AgentDriver(only tests constructed it with a driver).Salvaged from closed #153, rebuilt from main. Left out: the 64 MiB frame limit, the 1,000-hop default and the other parity items.
Tests
crates/agent-driver-acp/tests/session_ops.rs:IsolatedAcpHarness: methods land in the right process, a close that never answers still stops the process within seconds, and nothing is launched or sent when unadvertised.cargo test -p inline-agent-driver-acppasses;cargo test -p inline-cli bridgepasses (672 passed, 9 ignored).cargo clippy -p inline-agent-driver-acp -p inline-cli --all-targets -D warningsis clean.Follow-ups
/sessionsbrowser onHarnessDriver::sessions.held_byin ACP listings.session/deleteto the Archive op, if wanted.🤖 Generated with Claude Code