Skip to content

feat(agents): add codex-acp, gemini-acp, opencode-acp ACP adapters - #626

Merged
8nevil8 merged 3 commits into
codemie-ai:mainfrom
homich1991:feat/acp-adapters-codex-gemini-opencode
Oct 12, 2026
Merged

8nevil8 merged 3 commits into
codemie-ai:mainfrom
homich1991:feat/acp-adapters-codex-gemini-opencode

Conversation

@homich1991

Copy link
Copy Markdown
Contributor

Summary

Adds three new ACP (Agent Client Protocol) adapters — codex-acp, gemini-acp, opencode-acp — so IDEs (Zed, JetBrains, AIR) can drive Codex, Gemini CLI, and OpenCode directly via stdio JSON-RPC, matching the existing claude-acp/kimi-acp pattern. Also migrates claude-acp off the deprecated @zed-industries/claude-code-acp package, and fixes a telemetry mistagging bug surfaced along the way.

Changes

  • New agents: codex-acp (external adapter via @agentclientprotocol/codex-acp, configured through an injected CODEX_CONFIG env var), gemini-acp (native --acp mode, same gemini binary), opencode-acp (native acp subcommand, same opencode binary).
  • Fix: claude-acp migrated to @agentclientprotocol/claude-agent-acp (the deprecated @zed-industries/claude-code-acp package no longer receives updates).
  • Fix: codex.plugin.ts and opencode.plugin.ts hardcoded their base agent's clientType in session-start/incremental-sync/session-end telemetry, mistagging codex-acp/opencode-acp sessions as plain codex/opencode. Both now read env.CODEMIE_CLIENT_TYPE (already set by BaseAgentAdapter from each plugin's own ssoConfig.clientType), with a fallback that leaves plain Codex/OpenCode behavior unchanged.
  • Fix: request-sanitizer.plugin.ts was missing codemie-opencode-acp in its allowlist, even though opencode-acp shares the exact AI SDK request path the sanitizer patches.
  • Fix: syncProcessor.ts's conversation-folder routing was missing codex-acp/gemini-acp/opencode-acp.
  • Full registry/CLI/package.json/bmad.plugin.ts/analytics-report wiring for the three new agents.
  • Docs: README's consolidated ACP IDE-config section (Zed/JetBrains/JetBrains AIR) now covers all four ACP agents; new docs/AGENTS.md sections for Codex/Gemini/OpenCode ACP; docs/COMMANDS.md and root AGENTS.md updated.

Testing

  • Tests added/updated — new plugin-metadata/lifecycle tests for all three new ACP plugins, registry.test.ts updated, regression tests for the clientType fallback fix (Codex + OpenCode), new allowlist/folder-routing test cases.
  • npm run typecheck, npm run lint (0 warnings), npm run build all pass.
  • Full affected test suites pass (agents/codex, agents/opencode, agents/gemini, proxy plugins, conversation sync, registry).
  • Manual IDE testing (Zed/JetBrains) not performed — no live ACP client available in this environment.

Checklist

  • Code follows project standards
  • CI should be green (local npm run typecheck && npm run lint && npm run build + affected test suites pass)
  • No merge conflicts with main (branched from current main)

Adds three new ACP (Agent Client Protocol) adapters so IDEs (Zed, JetBrains,
AIR) can drive Codex, Gemini CLI, and OpenCode directly via stdio JSON-RPC,
alongside the existing claude-acp/kimi-acp:

- codex-acp: external adapter via @agentclientprotocol/codex-acp, configured
  through an injected CODEX_CONFIG env var (no --config flags, since the
  wrapper ignores stray argv).
- gemini-acp: native mode on the same gemini binary, prepends --acp.
- opencode-acp: native mode on the same opencode binary, prepends the acp
  subcommand.

Also migrates claude-acp off the deprecated @zed-industries/claude-code-acp
package to its renamed replacement, @agentclientprotocol/claude-agent-acp
(cliCommand: claude-agent-acp).

Wires all three into the registry, AgentCLI metadata map, package.json bin
entries, bmad.plugin.ts tool mapping, the analytics report's agent color
palette, and install.ps1's command list.
…ase agent's

codex.plugin.ts and opencode.plugin.ts hardcoded their base agent's
clientType ('codemie-codex' / 'codemie-opencode') in buildHookConfig() and
the incremental-sync buildContext()/buildUploadContext(), so sessions
launched by codex-acp/opencode-acp were mistagged as plain codex/opencode in
telemetry despite having their own distinct ssoConfig.clientType.

Both now read env.CODEMIE_CLIENT_TYPE (already set by BaseAgentAdapter from
metadata.ssoConfig.clientType for every agent) with a fallback to the old
hardcoded value, so plain Codex/OpenCode are unaffected and the ACP variants
are tagged correctly.

Also closes two gaps this surfaced for codex-acp/opencode-acp:
- request-sanitizer.plugin.ts's ALLOWED_AGENTS was missing
  codemie-opencode-acp, even though opencode-acp shares the exact same AI SDK
  request path (same opencode-ai binary) that the sanitizer exists to patch.
- syncProcessor.ts's resolveConversationFolder was missing codex-acp (added
  previously) and now gemini-acp/opencode-acp, so their conversations synced
  to the default folder instead of their agent-specific one.

header-injection.plugin.ts and codex-encrypted-content-sanitizer.plugin.ts
already correctly listed codemie-codex-acp from the prior commit.
Updates README's consolidated "ACP Agent usage in IDEs and Editors" section
to cover all four ACP agents (claude-acp, codex-acp, gemini-acp,
opencode-acp) across Zed, generic JetBrains, and JetBrains AIR, plus the
external-agents table.

Adds matching per-agent sections to docs/AGENTS.md (Codex ACP, Gemini CLI
ACP, OpenCode ACP), updates the Claude Code ACP section for the new package
name and the AIR config block, and extends docs/COMMANDS.md's agent command
reference.

Updates the root AGENTS.md Agent Plugins table to note each ACP variant and
its upstream package.
@8nevil8
8nevil8 merged commit 9963dc8 into codemie-ai:main Oct 12, 2026
5 checks passed
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.

2 participants