Skip to content

Add OpenCode V2 as a separate opt-in binary agent - #657

Merged
EugeneTheDev merged 5 commits into
agentclientprotocol:mainfrom
maxffarrell:update-opencode-v2
Oct 21, 2026
Merged

EugeneTheDev merged 5 commits into
agentclientprotocol:mainfrom
maxffarrell:update-opencode-v2

Conversation

@maxffarrell

@maxffarrell maxffarrell commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode 2 has ACP support and official standalone binaries, but the existing registry entry distributes OpenCode 1.18.34 from GitHub Releases. Add a separate opencode-v2 entry named OpenCode V2, allowing users to opt into the major upgrade. The existing opencode entry and its GitHub-based update behavior are unchanged.

The new entry pins v2.0.23 archives and official SHA-256 checksums for macOS, Linux, and Windows on arm64/x64. It copies the existing OpenCode icon and launches native opencode acp directly, without Node.js/npm installation. Windows targets use ./opencode.exe.

Register a custom stable updater only for opencode-v2, using https://opencode.ai/update/api/latest/cli/opencode. Future updates refresh URLs and checksums together through the existing custom-source mechanism. Reject incomplete platform sets, prerelease versions, mismatched URLs, and invalid checksums.

Migration caveat: separate registry entries isolate installation, not OpenCode configuration. V1 and V2 use the same configuration locations; converting settings to V2-only syntax can affect V1. V1 plugins require porting, server API integrations require migration, and V2 no longer supplies OpenCode LSP tools/diagnostics. See https://opencode.ai/v2/docs/migrate-v1/. ACP setup: https://opencode.ai/v2/docs/cli/acp/.

Validation:

  • Registry dry-run validates all 43 entries and URL accessibility; both OpenCode entries appear independently.
  • Live updater check for opencode,opencode-v2: both up to date, no errors.
  • Downloaded all six V2 archives, verified SHA-256 and archive-root executable paths.
  • On macOS Apple Silicon, the new opencode-v2 entry passes the standalone-binary authentication handshake and reports v2.0.23 and opencode-login(terminal). session/new, session/list, and session/resume succeed. session/fork rejects the empty test session; legacy session/stop and session/set_model are absent (V2 uses session/cancel and config-option controls).
  • Workflow tests: 212 passed, including V1 continuing to use GitHub without accessing the V2 feed, complete URL/checksum updates, and rejection of invalid feeds.
  • Ruff lint, format, and git diff whitespace checks pass.
  • Confirmed no diff to opencode/agent.json or opencode/icon.svg against upstream main.

Docker validation was attempted but the local daemon was unavailable, so repository scripts ran natively with isolated agent state. Windows/Linux archives were inspected but not executed. No authenticated model prompt or full Zed UI coding task was tested.

@maxffarrell
maxffarrell marked this pull request as draft October 6, 2026 02:02
@maxffarrell maxffarrell changed the title Update OpenCode to v2 via its official npm package Update OpenCode to v2 standalone binaries and official update feed Oct 6, 2026
@maxffarrell
maxffarrell marked this pull request as ready for review October 6, 2026 02:07
@maxffarrell maxffarrell changed the title Update OpenCode to v2 standalone binaries and official update feed Add OpenCode V2 as a separate opt-in binary agent Oct 6, 2026
@hussain

hussain commented Oct 11, 2026 •

Copy link
Copy Markdown

Patchbay, an ACP client for VS Code, has a user asking for OpenCode 2 (anomalyco/opencode#11176), so we tested this branch at 62d041d on 2026-10-11, covering the Linux and Windows gaps the description mentions.

Check Result
Linux x64 build_registry.py --dry-run, pytest (212), merge with main pass, clean merge
Linux x64 verify_agents.py -a opencode-v2 + --auth-check @ 2.0.23 pass (opencode-login)
Linux x64 update_versions.py --agents opencode-v2 --apply → 2.0.26, then --auth-check URLs and sha256 rewritten, pass
Windows x64 archive sha256 (2.0.23 pinned, 2.0.26 feed), ./opencode.exe at archive root match
Windows x64 ACP session: initialize, session/new, prompt writing a file, session/list, session/resume in a new process pass on 2.0.23 and 2.0.26

Notes: verify_agents.py --auth-check can't run on Windows (select() on pipes → WinError 10038), so the Windows row used our own ACP client. Separately, a fresh OpenCode 2.0.26 defaults to opencode/exo-free, which the server now rejects, so a new user's first prompt fails until they pick another model. That's tracked upstream in anomalyco/opencode#54065 and isn't caused by this entry.

cc @EugeneTheDev, since this is the second user of the CUSTOM_AGENT_SOURCES hook.

@hussain

hussain commented Oct 11, 2026

Copy link
Copy Markdown

One more data point for review, on the JetBrains side: anomalyco/opencode#54133 reports IntelliJ's OpenCode agent failing at launch for users who have OpenCode 2 installed. The opencode entry starts v1, v1 and v2 share ~/.config/opencode/opencode.json, and v1 refuses a config that has v2 permissions. This entry gives those users a v2 agent to pick. The shared-config caveat in the description is exactly this case.

@hussain

hussain commented Oct 19, 2026

Copy link
Copy Markdown

Asked OpenCode to publish V2 on GitHub Releases, which would let the standard updater carry it, and to say whether V1 must stay listed meanwhile: anomalyco/opencode#57058.

@EugeneTheDev EugeneTheDev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, one small verification nit, please take a look

@hussain

hussain commented Oct 21, 2026

Copy link
Copy Markdown

Thanks @EugeneTheDev. This unblocked OpenCode V2 across the registry at once: IntelliJ, Zed and ACP Patchbay users now install it in one click instead of writing a custom agent by hand.

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.

3 participants