Skip to content

feat: add OpenCode as a new ACP provider - #616

Merged
pikann merged 4 commits into
masterfrom
feature/add-opencode-as-new-acp-provider
Oct 21, 2026
Merged

pikann merged 4 commits into
masterfrom
feature/add-opencode-as-new-acp-provider

Conversation

@pikann

@pikann pikann commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #590

Adds OpenCode as a first-class ACP provider. Selecting it launches opencode acp through paca-acp-bridge, the same pattern as Goose. Before this, OpenCode could only be run through the custom provider with a hand-written command.

Changes

Bridge (apps/acp-bridge)

  • Registers opencode with default command opencode acp. It has no permission-bypass session mode, so the bridge auto-approves permission requests, as it does for Goose.
  • Provider tests for command resolution and permission mode.

API (services/api)

  • Allows opencode as an acp_provider value (entity, validation error message).
  • Migration 000071_add_opencode_acp_provider.sql recreates ck_agents_acp_provider with opencode. Without it, creating an OpenCode agent fails at the database.
  • Service test for creating an OpenCode ACP agent.

Web (apps/web)

  • OpenCode option in the create-agent dialog and the agent detail provider picker; ACPProvider type updated.
  • OpenCode logo (official brand glyph on a dark tile so it reads on light and dark themes) and mapping in provider-logos.ts.
  • Label translations in all 9 locales.
  • ACP bridge setup panel: MCP step fixed for non-Claude providers. The panel gave every provider except Claude Code a generic PACA_…=… npx -y @paca-ai/paca-mcp command. That only starts a stdio server in the terminal and never registers it with the CLI, so agents ran with no Paca tools (found while testing OpenCode: "Paca MCP tools are not connected in this session"). It now shows a real registration step per provider:
    • Codex: codex mcp add paca --env … -- npx -y @paca-ai/paca-mcp
    • Gemini CLI: gemini mcp add -s user -e … paca npx -- -y @paca-ai/paca-mcp
    • OpenCode: JSON block for ~/.config/opencode/opencode.json
    • Goose: YAML block for ~/.config/goose/config.yaml
    • Claude Code and Custom are unchanged.
  • The command box now preserves line breaks so multi-line config blocks are readable.

Skills installer (scripts/install-paca-skills.sh)

  • New opencode (~/.config/opencode/skills/) and goose (~/.agents/skills/) platforms, as menu options 5 and 6, --platforms/PACA_SKILL_PLATFORMS values, and number aliases. Both paths are taken from each tool's own docs. Skills are copied verbatim.
  • CI smoke test (scripts-pr-ci.yml) covers both new platforms.

Docs

  • Provider lists in the API design and database schema docs, install-skills.md (platform table, selection, uninstall), and a new OpenCode section in the bridge README.

Testing

  • go test for apps/acp-bridge/internal/provider, services/api/internal/service/agent and internal/domain/agent; tsc -b, biome, and the i18n/agents vitest suites pass.
  • Manually, in a container: installer run against a dev Paca (17 skills written to both folders, found by opencode debug skill, interactive menu verified); OpenCode connected to the Paca MCP server (opencode mcp list shows connected); codex mcp add and gemini mcp add syntax verified in a throwaway home.

Not verified / notes

  • Goose MCP YAML follows Goose's docs but was not run against a real Goose install.
  • Whether Gemini CLI's --acp mode reads settings.json MCP entries the same as a normal session is untested.
  • The OpenCode end-to-end chat through a real bridge was not completed.
  • OpenCode also reads ~/.agents/skills and ~/.claude/skills, so installing to several platforms makes it log harmless duplicate skill name warnings (first copy wins).

🤖 Generated with Claude Code

- Updated the agent detail and create agent dialog components to include OpenCode as a selectable ACP provider.
- Added translations for OpenCode in English, Spanish, French, Japanese, Korean, Portuguese, Russian, Vietnamese, and Chinese.
- Modified the agent API and provider logos to support OpenCode.
- Updated API documentation to reflect the addition of OpenCode as a valid ACP provider.
- Enhanced the database schema and migration scripts to include OpenCode in the ACP provider constraints.
- Added unit tests to verify the successful creation of agents with OpenCode as the ACP provider.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — two minor points inline.

Reviewed changes

This PR adds opencode as a first-class ACP provider across the bridge, API, web UI, skills installer, and docs, and reworks the ACP bridge setup panel's MCP step to emit provider-specific registration snippets.

  • Bridge provider registry — adds "opencode" → ["opencode", "acp"] with no permission mode (auto-approve, same as Goose), plus command-resolution and permission-mode tests. Correct and consistent with the existing Goose path.
  • API allowlist + migration — ACPProviderOpenCode in ValidACPProviders, updated error text, and migration 000071 dropping/recreating ck_agents_acp_provider with opencode; creation test added. Migration number is collision-free and the drop-then-add is re-runnable.
  • Web UI — ACPProvider union, create-agent and agent-detail select items, logo asset + mapping, and acpProviderOpenCode plus stepSkillMcpConnectLabelConfig in all 9 locales. All provider lists and locales are covered.
  • MCP setup step — per-provider output for Codex (codex mcp add … --env … --), Gemini CLI (gemini mcp add -s user -e …), OpenCode (JSON block), and Goose (YAML block). I verified all four formats against the tools' current official docs/source — they are correct.
  • Skills installer — new opencode (~/.config/opencode/skills/) and goose (~/.agents/skills/) platforms, aliases, menu entries, and CI smoke coverage. Verified the OpenCode plural skill path is real (v2 source scans both skill/skills).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/acp-bridge/README.md Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review at 720e6a58 — a README-only follow-up commit (a449af38).

  • OpenCode setup docs corrected — the bridge README now points users at the opencode installer platform and its ~/.config/opencode/skills/ path, replacing the earlier misattribution of that directory to the agents platform.
  • MCP config-version note added — the README now documents that the shown mcp.<name> shape targets current OpenCode 1.x releases, and that newer schemas move servers under mcp.servers and use disabled instead of enabled while still accepting the old form as deprecated. Verified against the live opencode.ai/config.json schema: the legacy top-level mcp.<name> branch is indeed marked deprecated: true but remains accepted, so the note is accurate.

Both prior inline threads are addressed and have been resolved. No new issues.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — one minor note inline on the new migration.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review at a449af38 (commit 7f2f92e).

  • MCP dispatch extracted — AcpBridgeSetup's nested provider ternary is replaced by a buildMcpConnectCommand switch. Behavior is unchanged: claude-code/codex/gemini-cli/opencode/goose resolve to their builders, everything else to the generic command.
  • Migration locking change — 000071 now adds ck_agents_acp_provider with NOT VALID and validates it on a separate statement, with a comment describing the intended non-blocking behavior.
  • Comment/copy tweaks — localAuthExportCommand and gooseMcpConfig doc comments reflowed (the latter now marked UNVERIFIED), and the installer menu notes that selecting OpenCode and Goose together duplicates skills.

The prior two inline threads remain addressed and resolved; no regressions found in the refactor.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review at 7f2f92e (commit 90643fc).

  • Migration constraint simplified — 000071 drops the NOT VALID + separate VALIDATE CONSTRAINT split and its comment, reverting to a single inline ADD CONSTRAINT ... CHECK (acp_provider IN (..., 'opencode', ...)). This directly addresses the prior inline note: the removed comment no longer asserts a non-blocking validation the single-transaction runner could not deliver, and the constraint still admits opencode.

The prior inline thread is addressed and resolved. No new issues.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 6bd67fe into master Oct 21, 2026
14 checks passed
@pikann
pikann deleted the feature/add-opencode-as-new-acp-provider branch October 21, 2026 07:13
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.

[Feature] Add OpenCode as a first-class paca-acp-bridge provider

1 participant