Skip to content

feat: Phase 1 ACP adoption — Codex adapter via ACP transport (#125)#127

Merged
c-h- merged 2 commits intomainfrom
feat/acp-phase1-code
Mar 9, 2026
Merged

feat: Phase 1 ACP adoption — Codex adapter via ACP transport (#125)#127
c-h- merged 2 commits intomainfrom
feat/acp-phase1-code

Conversation

@c-h-
Copy link
Copy Markdown
Collaborator

@c-h- c-h- commented Mar 9, 2026

Summary

Implements Phase 1 of ADR-001 (merged in #126): adopt ACP as the primary agent interface for agentctl.

What's included

  • Generic ACP adapter (src/adapters/acp/) — reusable ACP transport layer
  • ACP client (src/adapters/acp/acp-client.ts) — session lifecycle management (create, send, poll, terminate)
  • Codex-ACP adapter (src/adapters/codex-acp.ts) — launches Codex via ACP instead of PTY
  • CLI registrationcodex-acp available as adapter option in agentctl launch

Stats

  • 1,049 lines added across 10 files
  • 24 new tests (513 total, all passing)
  • Zero lint/build errors
  • Full backward compatibility — existing PTY adapters untouched

Testing

npm test  # 513 passed (32 test files)
npm run lint  # 0 issues
npm run typecheck  # clean

Phase 1 of #125.

Jarvis (OpenClaw) and others added 2 commits March 9, 2026 09:05
Add a generic ACP adapter layer that delegates agent launch/session/lifecycle
to ACP (Agent Client Protocol) instead of bespoke PTY scraping. This proves
the architecture described in ADR-001 with Codex as the first adapter.

New files:
- src/adapters/acp/acp-client.ts — ACP client wrapping the SDK's
  ClientSideConnection (spawn, connect, prompt, cancel, disconnect)
- src/adapters/acp/acp-adapter.ts — Generic AgentAdapter implementation
  backed by ACP (reusable for future Claude Code, OpenCode, Pi adapters)
- src/adapters/codex-acp.ts — Thin Codex config layer using
  @zed-industries/codex-acp as the ACP bridge
- 24 new tests (512 total, all passing)

The existing Codex PTY adapter remains as fallback. Users can select the
ACP transport with `--adapter codex-acp`.

Closes #125 (Phase 1)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@c-h-
Copy link
Copy Markdown
Collaborator Author

c-h- commented Mar 9, 2026

Nice direction overall, and CI is green, but I don't think this is merge-ready yet.

Blocker 1: codex-acp isn't actually shipped here.
The PR registers codex-acp in the CLI and src/adapters/codex-acp.ts says it falls back to the existing PTY adapter, but package.json only adds @agentclientprotocol/sdk; it does not add the @zed-industries/codex-acp bridge binary, and there's no fallback logic in the code. On a fresh install, agentctl launch codex-acp will just fail if codex-acp isn't already on PATH. Either vendor/install the bridge, document it as an explicit prerequisite, or keep this adapter experimental/unregistered for now.

Blocker 2: the ACP adapter isn't discover-first yet.
discover(), status(), resume(), and stop() all depend on the in-memory clients map populated by launch(). That means a fresh CLI process — or a daemon restart — can't rediscover or control existing ACP sessions. That's a pretty fundamental mismatch with agentctl's current contract and with the ADR claims about session persistence / crash recovery. I think Phase 1 needs either a real ACP rediscovery/reattach story, or this should stay behind an experimental flag until that exists.

Docs audit: README is stale once this lands. The CLI reference and adapter docs still list only claude-code, codex, opencode, pi, pi-rust, openclaw, and there's no install/usage section for codex-acp or its prerequisites. That should be updated before merge if the adapter stays user-visible.

Happy path / architecture direction looks good; I'd just fix the packaging + discoverability story before merging.

@c-h- c-h- merged commit 7e52612 into main Mar 9, 2026
1 check passed
c-h- pushed a commit that referenced this pull request Mar 10, 2026
Features:
- Phase 1 ACP adoption — Codex adapter via ACP transport (#127)
- Callback metadata + lifecycle webhooks (#123)
- ADR-001: adopt ACP as primary agent interface (#126)
- Stateless daemon core (#117)

Fixes:
- Eliminate pending- session IDs — resolve real ID at launch (#131)
- Webhook numeric exit_status + compatible HMAC headers (#128)
- Daemon env derivation at spawn time (#119)
- Binary resolve util update (#121)

Docs:
- Full documentation audit and alignment (#132)
c-h- added a commit that referenced this pull request Mar 10, 2026
Features:
- Phase 1 ACP adoption — Codex adapter via ACP transport (#127)
- Callback metadata + lifecycle webhooks (#123)
- ADR-001: adopt ACP as primary agent interface (#126)
- Stateless daemon core (#117)

Fixes:
- Eliminate pending- session IDs — resolve real ID at launch (#131)
- Webhook numeric exit_status + compatible HMAC headers (#128)
- Daemon env derivation at spawn time (#119)
- Binary resolve util update (#121)

Docs:
- Full documentation audit and alignment (#132)

Co-authored-by: Doink (OpenClaw) <charlie+doink@kindo.ai>
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