Skip to content

feat(cli): add ACP session creation and listing - #3744

Open
Sun-GLiang wants to merge 6 commits into
apache:mainfrom
Sun-GLiang:feat/acp-session-lifecycle
Open

feat(cli): add ACP session creation and listing#3744
Sun-GLiang wants to merge 6 commits into
apache:mainfrom
Sun-GLiang:feat/acp-session-lifecycle

Conversation

@Sun-GLiang

@Sun-GLiang Sun-GLiang commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the Runtime Host seams needed by ACP Session lifecycle work: a bounded single-page Session catalog reader and a one-shot subscription open that never retries on a replacement Host.
  • Add an ACP connection-scoped Session registry that creates durable Maka Sessions, continuously consumes one subscription per Session, tracks the latest snapshot, records subscription failures, and cleans up all adapter-owned resources on EOF.
  • Implement ACP session/new and cursor-paginated session/list through the official SDK, including canonical cwd filtering, legacy-record omission, stable Runtime Host error mapping, and explicit rejection of unsupported MCP server and additional-directory inputs.
  • Extend PR1's transport-only startup contract by owning the deliberately deferred Runtime Host bootstrap: the first implemented Host-backed Session method lazily creates one shared, abortable CLI Host context, while initialize and unsupported methods remain Host-independent.
  • Keep session/close unadvertised and returning -32601; durable Runtime Host Sessions are never deleted or archived by adapter cleanup. Active-turn cancellation and adapter-state removal remain follow-up work in PR4 and will be revalidated before that PR starts.

Refs #3132
Builds on #3658 (merged)

PR1 alignment

  • Rebased onto main after feat(cli): add ACP stdio server foundation #3658 merged; the PR now contains only the PR2 delta.
  • Reuses PR1's official SDK transport and child-process harness rather than introducing a second ACP server path.
  • Implements the Runtime Host connection work deliberately deferred by PR1, without weakening PR1's Host-free initialize contract.

Verification

  • Focused post-rebase ACP/Host-bootstrap suite — 49 passed, 0 failed, including the official SDK client with a real Runtime Host process.
  • npm --workspace maka-agent test — repository total 519 passed, 1 unrelated macOS /private/var versus /var installation-path assertion failed.
  • npm --workspace @maka/runtime-host test — 1243 passed, 0 failed, 9 skipped.
  • npm run typecheck
  • npm run lint
  • npm run format:check
  • git diff --check
  • git range-diff confirms the six PR2 commits were preserved across the rebase; the only manual conflict resolution retained both current main connection-availability notifications and PR2's one-shot subscription open.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex assisted with implementation, tests, rebase/conflict resolution, verification, and review. Every PR2 commit includes a Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Sun-GLiang
Sun-GLiang force-pushed the feat/acp-session-lifecycle branch from 67c6644 to 4ed9973 Compare August 26, 2026 10:08
@Sun-GLiang
Sun-GLiang marked this pull request as ready for review August 26, 2026 10:20
@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Aug 27, 2026
@Sun-GLiang
Sun-GLiang force-pushed the feat/acp-session-lifecycle branch from 4ed9973 to 951bd81 Compare August 29, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant