Skip to content

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

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

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

Conversation

@Sun-GLiang

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.
  • Preserve PR1's probeable startup contract: Runtime Host connection is delayed until the first implemented Session method, concurrent Session calls share the same abortable connection, and initialize or unsupported methods do not start Host discovery.
  • Keep session/close unadvertised and returning -32601; durable Runtime Host Sessions are never deleted or archived by adapter cleanup. Its active-turn cancellation and adapter-state removal remain follow-up work.

Refs #3132
Depends on #3658

Stacking

This Draft is based on the current head of #3658. Because that branch lives in a fork and cannot be selected as an upstream base branch, GitHub currently shows the combined PR1 + PR2 diff against main.

Verification

  • npm --workspace maka-agent test — 462 passed, 0 failed
  • npm --workspace @maka/runtime-host test — 1124 passed, 0 failed
  • npm run format:check
  • npm run lint
  • npm run typecheck
  • npm run check:asf-headers
  • npm run check:release — 109 passed, 0 failed
  • npm run release:cli:pack with the repository-pinned npm 11.19.0
  • npm run release:cli:smoke — installed and exercised the immutable tarball offline

Repository-wide npm test still reproduces an unchanged macOS Runtime executable-root assertion. Under the parallel root runner, one long Runtime Host startup-recovery test also exceeded its timing budget; the complete Runtime Host suite passes when run standalone as shown above.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant