Skip to content

feat: Add OpenCode as first-class native agent - #1741

Draft
jdistler wants to merge 5 commits into
slopus:mainfrom
jdistler:feat/opencode-native-agent
Draft

feat: Add OpenCode as first-class native agent#1741
jdistler wants to merge 5 commits into
slopus:mainfrom
jdistler:feat/opencode-native-agent

Conversation

@jdistler

Copy link
Copy Markdown

Summary

Adds OpenCode as a first-class native agent across Happy (happy-cli, happy-agent, and happy-app), resolving #265 and implementing the proposal in #1631 with scope guidance from @bra1nDump:

  • Pure ACP protocol over stdio (opencode acp)
  • First-class native app support: dedicated agent picker icon, model modes, permission modes, and remote spawn from mobile/web
  • End-to-end integration verified locally with installed OpenCode CLI (1.18.25)

Closes #265, Closes #1631. cc @bra1nDump

Changes

1. packages/happy-cli

  • Added top-level happy opencode CLI subcommand invoking runAcp with { agentName: 'opencode', command: 'opencode', args: ['acp'] }.
  • Added opencode to --help usage and examples.
  • Updated daemon session spawning (spawnSession in src/daemon/run.ts) to handle options.agent === 'opencode'.
  • Updated daemon controlServer.ts and registerCommonHandlers.ts schemas to accept opencode as an agent.
  • Updated CLI availability detection in src/utils/detectCLI.ts and src/api/types.ts (opencode: boolean). Added unit tests in detectCLI.test.ts.

2. packages/happy-agent

  • Added 'opencode' to SupportedAgent and SUPPORTED_AGENTS in src/machineRpc.ts and src/index.ts.

3. packages/happy-app

  • Catalog & Discovery: Added opencode to HARNESS_NAMES, HARNESS_ORDER, and availability checks in sources/utils/harnessCatalog.ts and sources/sync/machineChoices.ts.
  • Defaults & State: Added opencode to agentKeys, CODE_AGENT_DEFAULTS, persistence.ts, and ops.ts.
  • Modes: Added getOpenCodePermissionModes and getOpenCodeModelModes with custom model mode support in sources/components/modelModeOptions.ts.
  • UI & Assets:
    • Added official OpenCode icon assets (icon-opencode.png, @2x.png, @3x.png) to sources/assets/images/.
    • Wired avatar badges in Avatar.tsx and avatarHarness.ts.
    • Added OpenCode to new session picker (app/(app)/new/index.tsx), agent settings (app/(app)/settings/agents.tsx), and composer (AgentInput.tsx).
    • Added translations across all 10 supported locale files.

Verification

  • Verified ACP handshake and session/new lifecycle directly against local OpenCode CLI (opencode acp).
  • Tested happy opencode end-to-end (spawned session and verified Status: starting -> Status: idle).
  • Full unit test suites pass:
    • packages/happy-cli: 87/87 test files (820 tests) passed.
    • packages/happy-app: 106/106 test files (1,121 tests) passed.
  • tsc --noEmit typechecks pass cleanly with 0 errors across all packages.

@jdistler
jdistler marked this pull request as draft August 31, 2026 17:46
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.

feat: Add OpenCode as first-class native agent OpenCode Support

1 participant