Repository navigation
feat: support OpenCode 2.x - #36
Merged
Merged
Conversation
opencode run only reports "Unexpected server error. Check server logs for details.", and the logs went to a temporary home the test then discarded. Send them to stderr, which the failure message already includes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenCode 2 ships as a separate npm package (@opencode/cli) and renames most of what the guide and the harness test rely on: `providers`/`settings.baseURL`/ `package` instead of `provider`/`options.baseURL`/`npm`, `agents.title.model` instead of `small_model`, a `shell` tool (only `command`, no `description`) instead of `bash`, and a background service shared by all OpenCode processes. Its catalog no longer lists claude-sonnet-4-5, and it silently swaps an unknown model for its default one. - docs/opencode.md: an OpenCode 2.x section next to the 1.x one. - tests/harnesses/test_opencode.py: picks the config, shell tool and models from `opencode --version`, runs 2.x with --standalone, and checks that the configured model is the one OpenCode called. - CI: test opencode-ai@1.19.3 and @opencode/cli@2.3.0 on pull requests, plus @opencode/cli@latest on main. The 1.x `latest` job goes: 1.x now nags to upgrade, and 1.19.6 broke its Anthropic provider. Checked locally against OpenCode 2.3.0 and 1.19.5: the guard needs no change (2.x's Anthropic and OpenAI-compatible providers use Messages and Chat Completions; the built-in openai provider still uses the Responses API). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds OpenCode 2.x to the OpenCode guide and its harness test, and fixes the
harness / opencodefailure onmain.Why
mainis red. Theopencode latestjob installs the newestopencode-ai, and 1.19.6 (released 2026-11-17 07:22 UTC) broke its Anthropic provider (UnknownError: Unexpected server error). The pinned 1.19.3 job still passes. 1.x is now in maintenance and prompts users to upgrade to 2.x, which ships as a separate npm package,@opencode/cli, so thelatestjob could never have tested 2.x anyway.What 2.x changes for us (checked by running 2.3.0 through safeagents against the scripted model):
providers.<id>.settings.baseURLinstead ofprovider.<id>.options.baseURL,packageinstead ofnpm(@opencode/ai/providers/openai-compatible),agents.title.modelinstead ofsmall_model,policiesinstead ofdisabled_providers. 1.x configs still load.shellwith{command}only; its schema rejects thedescription1.x required.claude-sonnet-4-5and silently swaps an unknown model for its default (claude-fable-5-2), so the guide usesclaude-sonnet-5-5.--standalonefor isolation; the guide notesopencode service restartafter changing keys./v1/messages, Chat Completions at/v1/chat/completions. The built-inopenaiprovider still uses/v1/responses, so the warning stays.executetool (Code Mode) wraps tool calls in code. The guard's checks match argument text, socurlto an unknown host orsafeagents stopinsideexecuteis blocked like ashellcall.Changes
docs/opencode.md: an OpenCode 2.x section before the 1.x one, plus 2.x notes.docs/README.mdmarks both as supported.tests/harnesses/test_opencode.py: picks config, shell tool, models and run flags fromopencode --version. Newcheck_modelasserts OpenCode called the configured model (it fails withOpenCode called {'claude-fable-5-2'}on a stale model name). Includes the earlier--print-logscommit, so a failure shows OpenCode's own server error..github/workflows/harness-opencode.yml: pull requests testopencode-ai@1.19.3and@opencode/cli@2.3.0; pushes tomainadd@opencode/cli@latest. The 1.xlatestjob is dropped.Tests: opencode harness 6/6 against 2.3.0 and 6/6 against 1.19.5 locally; full suite 134 passed, 33 skipped.
🤖 Generated with Claude Code