You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ACP: re-mount client MCP on session/load + mid-session teardown (Slice B of #7) #9
session/load re-mount. Today session/load hard-rejects any client mcpServers (fail-loud). A re-attaching editor that re-sends its streaming-HTTP servers on load should get them re-mounted into a per-session engine, same as session/new. ACP allows mcpServers on session/load. Needs a LoadSessionWithMCP symmetric to CreateSessionWithMCP, reusing the existing SessionEngineFactory seam — no persistence required (the editor re-sends the specs).
Mid-session teardown. Per-session MCP connections currently close only on editor disconnect (closeTrackedSessions) or process exit (Service.Close). ACP has no per-session-end RPC, so a long-lived connection that opens many sessions holds their MCP connections until disconnect. Consider a finer teardown hook if a real need emerges. (Connection-lifetime teardown is correct for a typical interactive editor; this is a refinement.)
Shipped — closing as done (both slices of Slice B)
1. session/load re-mount — 943ab7e
Service.LoadSessionWithMCP, symmetric to CreateSessionWithMCP, reusing the existing SessionEngineFactory seam (no new seam, no proto change). Empty specs delegate to LoadSession (shared engine); with specs it loads/reopens first (so an unknown id fails fast with no wasted MCP connect), then builds + registers the per-session engine. handleSessionLoad switched from the blanket reject to the same partitionClientMCP + re-mount + trackSession flow as session/new — stdio/sse reject, SSRF allowlist, server cap, and connect timeout all apply identically. A re-load leak guard closes a prior per-session engine before replacing for the same id. fs/* on load deliberately stays osfs (separate deferred item).
2. Mid-session teardown — 0c79b94
Originally proposed for deferral on the premise that "ACP has no per-session-end RPC."That premise was wrong — ACP defines a first-class session/close request (capability-gated by agentCapabilities.sessionCapabilities.close, confirmed against the canonical schema). So we wired the real signal rather than a TTL/LRU heuristic. handleSessionClose cancels any in-flight run (spec-mandated "MUST cancel ongoing work"), untracks the session (so the disconnect path doesn't double-close), then runs Service.EndSession. It shares the EndSession teardown step with the #10 gRPC CloseSession RPC / HTTP DELETE, but is not behaviorally identical — only session/close cancels; the others leave cancel to a separate endpoint. Confined to the acp adapter — no new Service method, port, clock, or goroutine.
No deferred items remain. Tests offline (mockllm + memfs); reviewed across spec + standards + security + architecture panels for each commit.
Aside: while evaluating whether to adopt an ACP Go library vs the hand-rolled adapter, we found and fixed a separate transport bug — conn.go framed messages with LSP-style Content-Length headers, but ACP mandates newline-delimited JSON, so it couldn't interop with a real client (fixed in b7aef5a, with the loopback test blind-spot closed).
Activity
JAORMX commentedon Jun 1, 2026
Shipped — closing as done (both slices of Slice B)
1. session/load re-mount —
943ab7eService.LoadSessionWithMCP, symmetric toCreateSessionWithMCP, reusing the existingSessionEngineFactoryseam (no new seam, no proto change). Empty specs delegate toLoadSession(shared engine); with specs it loads/reopens first (so an unknown id fails fast with no wasted MCP connect), then builds + registers the per-session engine.handleSessionLoadswitched from the blanket reject to the samepartitionClientMCP+ re-mount +trackSessionflow assession/new— stdio/sse reject, SSRF allowlist, server cap, and connect timeout all apply identically. A re-load leak guard closes a prior per-session engine before replacing for the same id. fs/* on load deliberately stays osfs (separate deferred item).2. Mid-session teardown —
0c79b94Originally proposed for deferral on the premise that "ACP has no per-session-end RPC." That premise was wrong — ACP defines a first-class
session/closerequest (capability-gated byagentCapabilities.sessionCapabilities.close, confirmed against the canonical schema). So we wired the real signal rather than a TTL/LRU heuristic.handleSessionClosecancels any in-flight run (spec-mandated "MUST cancel ongoing work"), untracks the session (so the disconnect path doesn't double-close), then runsService.EndSession. It shares theEndSessionteardown step with the #10 gRPCCloseSessionRPC / HTTPDELETE, but is not behaviorally identical — onlysession/closecancels; the others leave cancel to a separate endpoint. Confined to the acp adapter — no new Service method, port, clock, or goroutine.No deferred items remain. Tests offline (mockllm + memfs); reviewed across spec + standards + security + architecture panels for each commit.
feat(acp): re-mount client MCP on session/load + defer mid-session te…
feat(acp): mid-session teardown via session/close (#9)
Listener-scoped workspace authority (ADR 0237) (#763)