Skip to content

Migrate built-in coding agents to Generic ACP#95

Merged
mingyooagi merged 7 commits into
mainfrom
codex/acp-builtins
Jul 15, 2026
Merged

Migrate built-in coding agents to Generic ACP#95
mingyooagi merged 7 commits into
mainfrom
codex/acp-builtins

Conversation

@mingyooagi

@mingyooagi mingyooagi commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the separate Codex, Claude Code, and Hermes direct executors with one Generic ACP host and data-driven built-in definitions.
  • Support Codex, Claude Code, Cursor, OpenCode, Hermes, and OpenClaw through the same manifest/configuration path.
  • Keep built-in package/version provenance pinned in static definitions; remove the external ACP Registry parser/resolver because it had no runtime consumer.
  • Harden cancellation reporting and cleanup: fail-closed custom-agent defaults, observed termination state, POSIX process-group cleanup, Windows taskkill /T /F, and real conformance deadlines.
  • Align CLI/Lark catalogs, live preflight, capability output, and packaged-manifest release gates with the six built-ins.
  • Remove the legacy direct-executor implementations and provider-specific suites. The complete PR is net-negative (+2512 / -2571, net -59).

Additional ACP-compatible agents now require a built-in definition/configuration entry instead of another executor implementation.

Validation

  • corepack pnpm test — 120 files, 1551 tests passed
  • corepack pnpm typecheck
  • corepack pnpm lint — all 23 workspace projects passed
  • corepack pnpm build
  • npm_config_cache=/tmp/opentag-npm-cache npm run release:check — package, clean install, CLI help/doctor, and installed ACP launch definitions passed
  • Focused runner/local-runtime/CLI regressions — 150 tests passed
  • Live-preflight syntax and built-in dry-run checks passed
  • Independent standards/specification re-review found no remaining issue in the requested scope
  • git diff --check

OpenClaw cancellation status

OpenClaw is admitted as a built-in ACP agent with supportsCancel: false. Normal ACP runs are supported. OpenTag still sends the ACP cancellation request and forcibly closes its local bridge process, but it does not claim that Gateway-owned shell/tool subprocesses have terminated. The batch therefore marks OpenClaw's process-tree cancellation case not_applicable; the separate strict hard-cancellation probe remains available.

The upstream hard-cancellation fix is tracked in openclaw/openclaw#107721.

A local smoke against OpenClaw 2026.7.1 reached the ACP bridge. The local Gateway was not running at 127.0.0.1:18789, so readiness was correctly recorded as needs_setup, cancellation as not_applicable, and conformance failures as zero. This is provider setup state, not a merge blocker for this PR.

Summary by CodeRabbit

  • New Features

    • Added support for Cursor, OpenCode, and OpenClaw alongside existing coding-agent options.
    • Expanded CLI setup and initialization choices for built-in ACP agents.
    • Added Generic ACP launch configuration support, including configurable profiles and Gateway settings.
  • Bug Fixes

    • Improved agent readiness checks, environment safety, process-tree cancellation, and progress messaging.
    • OpenClaw cancellation is now clearly reported as best-effort when termination cannot be confirmed.
  • Documentation

    • Updated setup, configuration, integration, and troubleshooting guidance.
    • Node.js 22+ is now required.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60f37a1c-9640-4992-a075-f5372e129243

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

OpenTag migrates provider-specific executor handling to a generic ACP runtime, adds Cursor, OpenCode, Hermes, and OpenClaw support, introduces readiness and process-tree conformance checks, rejects legacy Claude direct-adapter configuration, and updates documentation, scripts, tests, and Node.js requirements.

Changes

ACP runtime

Layer / File(s) Summary
Generic ACP runner and lifecycle
packages/runner/src/*, packages/runner/test/*
Adds generic ACP agent factories, built-in definitions, secured launch environments, readiness probing, session-mode selection, process-tree cancellation, and OpenClaw best-effort cancellation handling.
ACP configuration and daemon wiring
packages/local-runtime/src/*, packages/cli/src/config.ts, apps/opentagd/src/index.ts
Replaces manifest-backed agent configuration with compact launch definitions, adds OpenClaw settings, expands executor identifiers, and rejects legacy Claude direct-adapter settings.
Executor catalog and capability contracts
packages/cli/src/catalogs/*, packages/core/src/*, packages/cli/test/*, packages/core/test/*
Adds Cursor, OpenCode, and OpenClaw catalog entries and updates executor capability, detection, default-selection, and hint validation behavior.
ACP conformance and release validation
scripts/test/*, scripts/release/check-cli-package.mjs, package.json
Adds built-in ACP conformance cases for readiness, working directories, commits, cancellation, and failure classification, and validates installed launch definitions during release checks.
Documentation and integrations
README*, docs/*, skills/*, scripts/dev/*, packages/{discord,teams,telegram}/*
Updates ACP executor guidance, Claude authentication instructions, OpenClaw cancellation semantics, Node.js requirements, local scripts, examples, and progress-message matching.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating built-in coding agents to Generic ACP.
Description check ✅ Passed The description matches the template well, with clear Summary and Validation sections; the Notes content is present but not labeled as a Notes heading.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/acp-builtins

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mingyooagi
mingyooagi marked this pull request as ready for review July 15, 2026 15:14

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions OpenTag to a unified, generic ACP-first (Agent Client Protocol) runner architecture, replacing direct adapters for Codex, Claude Code, and Hermes with a generic ACP host and built-in launch profiles. It introduces support for Cursor, OpenCode, and OpenClaw, updates the Node.js requirement to version 22, and adds a comprehensive ACP conformance test suite. Feedback is provided regarding a potential compatibility issue with git init -b on older Git versions, suggesting a fallback to git init and git branch -m instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/test/builtin-acp-conformance.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/runner/src/acp-executor.ts (1)

628-656: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Derive cancellation confirmation from observed behavior, not supportsCancel.

supportsCancel only declares protocol capability. It does not prove that cancellation was accepted or that the process tree exited, yet it directly controls the result summary. Return termination status from terminateChild and track ACP notification/stop outcomes; early cancellation before spawning can be confirmed immediately.

Also applies to: 771-807, 991-999

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/runner/src/acp-executor.ts` around lines 628 - 656, The cancellation
result in stopResult must use observed termination state rather than the
protocol capability flag supportsCancel. Make terminateChild return whether
termination completed, track ACP cancellation notification and stop outcomes
through the execution flow, and mark cancellation as confirmed when it occurs
before spawning; pass that derived status into stopResult so the summary and
nextAction reflect actual provider-process termination.
🧹 Nitpick comments (2)
scripts/release/check-cli-package.mjs (1)

111-134: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover Cursor and OpenCode in the installed-package release gate.

These are new built-in ACP agents, but this probe can still pass if their packaged launch definitions or Registry provenance are broken.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/release/check-cli-package.mjs` around lines 111 - 134, Extend the
installed-package release validation loop in the expected agent definitions to
include Cursor and OpenCode, using their packaged launch arguments and required
Registry provenance checks. Ensure manifests and definitions for both new
built-in ACP agents are validated alongside codex and claude-code, while
preserving the existing validation behavior.
packages/local-runtime/test/config.test.ts (1)

57-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the OpenClaw launch mapping, not only its capabilities.

This test still passes if command, profile, or gatewayUrl is dropped before createBuiltInAcpExecutors. Inspect the generated launch descriptor or spy on the factory arguments so the configuration contract named by the test is covered.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/local-runtime/test/config.test.ts` around lines 57 - 70, Update the
test around executorsFromConfig to inspect the generated OpenClaw launch
descriptor or spy on the built-in ACP factory arguments, asserting that command,
profile, and gatewayUrl from parseDaemonConfig are preserved. Keep the existing
capability assertions and verify the mapped launch configuration, not just
executor metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 17-18: Resolve the duplicate npm scripts by updating
smoke:acp-conformance to invoke its intended distinct conformance suite, such as
openclaw-acp-conformance.ts, or remove the redundant script if no separate suite
exists; keep smoke:builtin-acp-conformance mapped to builtin-acp-conformance.ts.

In `@packages/cli/src/config.ts`:
- Around line 200-202: Update the supportsCancel field in the configuration
schema to default to false so custom ACP agents must explicitly attest to
confirmed cancellation capability; leave supportsProfile and readinessTimeoutMs
unchanged.

In `@packages/cli/test/executors.test.ts`:
- Around line 33-47: Update the assertions in the executor output test to
validate capabilities against the correct executor lines rather than using
global substring checks. Assert complete Codex, Hermes, and OpenClaw entries, or
isolate and parse each executor’s line before checking fields such as completion
and secrets, while preserving the expected capability values.

In `@packages/runner/src/acp-executor.ts`:
- Around line 483-528: Update terminateChild and the Windows branch of
signalProcessTree to terminate the entire ACP process tree rather than only the
adapter process, using a tree-wide mechanism such as a Job Object or taskkill
/T. Preserve the existing graceful-then-forced termination sequence and add a
Windows-specific test covering descendant processes.

In `@packages/runner/src/acp-registry.ts`:
- Around line 164-169: Update packageIsPinned to require npm versions with at
least three numeric components before treating a package as pinned, while
preserving the existing uvx handling and valid exact-version behavior. Add
floating-agent@1.2 to the needs_setup regression cases in
packages/runner/test/acp-registry.test.ts lines 100-117.

In `@packages/runner/src/security.ts`:
- Around line 260-262: Update isExplicitlySafeEnvName in
packages/runner/src/security.ts (lines 260-262) to compare environment names
exactly on POSIX while retaining case-insensitive matching on Windows. Extend
packages/runner/test/security.test.ts (lines 106-116) with a differently cased
sensitive variable and assert that it is removed.

In `@scripts/dev/start-lark.sh`:
- Around line 178-204: Align detect_executor, validate_executor, and
assert_executor_available with the ACP registry’s complete built-in executor set
by adding Cursor, OpenCode, and OpenClaw. Update the executor prompt/list to
include all built-in IDs, and preflight every launcher, including Codex and
Claude Code; use npx availability checks for executors backed by registry
packages rather than treating any launcher as implicitly available.

In `@scripts/test/builtin-acp-conformance.ts`:
- Around line 259-276: Update boundedRun to enforce runTimeoutMs by racing
executor.run against a rejecting deadline rather than only setting timedOut and
awaiting the run. When the deadline fires, cancel the run and ensure
cancellation cleanup is bounded by a separate grace period, so neither the agent
run nor cancel can stall indefinitely; preserve the existing success result and
timeout diagnostics for runs completing before the deadline.

In `@scripts/test/live-e2e-smoke.mjs`:
- Around line 33-38: Update the requiredCommands configuration to preflight
every selected ACP launcher: conditionally include npx when builtInAcpAgents
selects Codex, Claude Code, or OpenCode, and include the Cursor launcher when
Cursor is selected. Preserve the existing Hermes and OpenClaw checks.

---

Outside diff comments:
In `@packages/runner/src/acp-executor.ts`:
- Around line 628-656: The cancellation result in stopResult must use observed
termination state rather than the protocol capability flag supportsCancel. Make
terminateChild return whether termination completed, track ACP cancellation
notification and stop outcomes through the execution flow, and mark cancellation
as confirmed when it occurs before spawning; pass that derived status into
stopResult so the summary and nextAction reflect actual provider-process
termination.

---

Nitpick comments:
In `@packages/local-runtime/test/config.test.ts`:
- Around line 57-70: Update the test around executorsFromConfig to inspect the
generated OpenClaw launch descriptor or spy on the built-in ACP factory
arguments, asserting that command, profile, and gatewayUrl from
parseDaemonConfig are preserved. Keep the existing capability assertions and
verify the mapped launch configuration, not just executor metadata.

In `@scripts/release/check-cli-package.mjs`:
- Around line 111-134: Extend the installed-package release validation loop in
the expected agent definitions to include Cursor and OpenCode, using their
packaged launch arguments and required Registry provenance checks. Ensure
manifests and definitions for both new built-in ACP agents are validated
alongside codex and claude-code, while preserving the existing validation
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c3bf8112-32fe-4a60-bdbf-ce12c20aed28

📥 Commits

Reviewing files that changed from the base of the PR and between db493dd and 47c1377.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (81)
  • README.md
  • README.zh-CN.md
  • apps/opentagd/src/index.ts
  • apps/opentagd/test/config.test.ts
  • docs/acp-agent-integration.md
  • docs/acp-first-agent-runtime-design.md
  • docs/agent-install.md
  • docs/configuration.md
  • docs/lark-local-start.md
  • docs/live-e2e-smoke-harness.md
  • docs/platforms/teams.en.md
  • docs/platforms/teams.zh-CN.md
  • docs/real-integration-smoke-test.md
  • examples/github-to-echo/README.md
  • examples/github-to-pr/README.md
  • package.json
  • packages/cli/README.md
  • packages/cli/package.json
  • packages/cli/src/catalogs/capabilities.ts
  • packages/cli/src/catalogs/executors.ts
  • packages/cli/src/config.ts
  • packages/cli/src/index.ts
  • packages/cli/test/capabilities.test.ts
  • packages/cli/test/config.test.ts
  • packages/cli/test/docs-contract.test.ts
  • packages/cli/test/executors.test.ts
  • packages/core/src/mention.ts
  • packages/core/src/schema.ts
  • packages/core/test/mention.test.ts
  • packages/core/test/schema.test.ts
  • packages/discord/src/render.ts
  • packages/dispatcher/test/presentation.test.ts
  • packages/dispatcher/test/server.test.ts
  • packages/local-runtime/README.md
  • packages/local-runtime/package.json
  • packages/local-runtime/src/config.ts
  • packages/local-runtime/src/runtime.ts
  • packages/local-runtime/test/config.test.ts
  • packages/local-runtime/test/doctor.test.ts
  • packages/local-runtime/test/hermes-daemon.test.ts
  • packages/runner/README.md
  • packages/runner/package.json
  • packages/runner/src/acp-agent.ts
  • packages/runner/src/acp-executor.ts
  • packages/runner/src/acp-registry.ts
  • packages/runner/src/builtin-acp.ts
  • packages/runner/src/claude-code.ts
  • packages/runner/src/codex.ts
  • packages/runner/src/hermes-profile.ts
  • packages/runner/src/hermes.ts
  • packages/runner/src/index.ts
  • packages/runner/src/security.ts
  • packages/runner/test/acp-agent.test.ts
  • packages/runner/test/acp-executor.test.ts
  • packages/runner/test/acp-registry.test.ts
  • packages/runner/test/builtin-acp-conformance-script.test.ts
  • packages/runner/test/builtin-acp.test.ts
  • packages/runner/test/claude-code.test.ts
  • packages/runner/test/codex.test.ts
  • packages/runner/test/executor-capability.test.ts
  • packages/runner/test/fixtures/acp-agent.mjs
  • packages/runner/test/hermes-profile.test.ts
  • packages/runner/test/hermes.test.ts
  • packages/runner/test/security.test.ts
  • packages/teams/README.md
  • packages/teams/src/render.ts
  • packages/teams/test/render.test.ts
  • packages/telegram/src/render.ts
  • scripts/dev/run-gh-claude-local-test.sh
  • scripts/dev/run-github-webhook-live-test.sh
  • scripts/dev/run-slack-claude-local-test.sh
  • scripts/dev/run-slack-ui-trigger-local-test.sh
  • scripts/dev/start-github-slack-claude-test.sh
  • scripts/dev/start-lark.sh
  • scripts/release/check-cli-package.mjs
  • scripts/test/builtin-acp-conformance.ts
  • scripts/test/hermes-v018-profile-contract.mjs
  • scripts/test/live-e2e-smoke.mjs
  • scripts/test/openclaw-acp-conformance.ts
  • skills/opentag/SKILL.md
  • skills/opentag/references/codex-runner.md
💤 Files with no reviewable changes (12)
  • scripts/test/hermes-v018-profile-contract.mjs
  • packages/local-runtime/test/hermes-daemon.test.ts
  • scripts/dev/start-github-slack-claude-test.sh
  • packages/runner/test/claude-code.test.ts
  • packages/runner/test/hermes.test.ts
  • packages/runner/src/codex.ts
  • packages/runner/src/claude-code.ts
  • packages/runner/src/hermes.ts
  • packages/runner/test/codex.test.ts
  • scripts/dev/run-gh-claude-local-test.sh
  • scripts/dev/run-slack-ui-trigger-local-test.sh
  • scripts/dev/run-slack-claude-local-test.sh

Comment thread package.json Outdated
Comment thread packages/cli/src/config.ts
Comment thread packages/cli/test/executors.test.ts Outdated
Comment thread packages/runner/src/acp-executor.ts Outdated
Comment thread packages/runner/src/acp-registry.ts Outdated
Comment thread packages/runner/src/security.ts Outdated
Comment thread scripts/dev/start-lark.sh
Comment thread scripts/test/builtin-acp-conformance.ts
Comment thread scripts/test/live-e2e-smoke.mjs
@mingyooagi mingyooagi changed the title Migrate built-in coding agents to registry-driven ACP Migrate built-in coding agents to Generic ACP Jul 15, 2026
@mingyooagi

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mingyooagi

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates OpenTag's coding agent execution layer from direct, custom adapters to a unified, generic Agent Client Protocol (ACP) host. It removes the dedicated claude-code and codex executors in favor of built-in ACP launch profiles, while expanding support to include cursor, opencode, hermes, and openclaw as built-in ACP agents. Additionally, the minimum Node.js requirement is bumped from version 20 to 22, configuration schemas are updated to enforce explicit workspace conformance (workspaceCwd: "required"), and a new built-in ACP conformance test suite is introduced to verify readiness, workspace paths, and process-tree cancellation. Since there are no review comments provided, I have no feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mingyooagi
mingyooagi merged commit 8e3c471 into main Jul 15, 2026
2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 15, 2026
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