chore(opencode): point config at authenticated models, document the delegation contract - #810
Conversation
…t the delegation contract opencode.json named anthropic/claude-sonnet-4-5 and anthropic/claude-haiku-4-5 as its defaults, but only OpenCode Zen and OpenCode Go are authenticated and the catalog carries zero anthropic/ models. Any run that fell back to the config default therefore failed outright -- the config predates the Zen/Go subscriptions. Now opencode-go/glm-5.2 and opencode-go/deepseek-v4-flash, both on the flat-rate plan. Verified: a bare `opencode run` now answers where it previously could not resolve a provider. Also drops the opencode-snip plugin: its binary is not on PATH, so it errored on every single run. CLAUDE.md gains the delegation contract, each rule attached to the thing that broke: - relay only, never a raw `opencode run` -- permissions are edit/bash/read/task = "ask", which blocks forever headless without the relay's --auto - --model always, from opencode-go/* -- opencode/* is Zen and metered - brief via file, never argv -- ~1.5KB of argv hung past 180s; the same text attached as a file returned in 11s - opencode.json is the tooling surface (CLAUDE.md + 17 instruction files, 6 MCP servers, 4 agents, 5 commands), which is why a delegated diff can honour invariants the brief never restated States plainly that only glm-5.2 has been measured, so the rest of the list isn't implied to be ranked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vm4Bw59Ntm1a9c7cPRsZe5
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change updates OpenCode model and plugin settings. It adds delegation workflow guidance and updates the React 19 title-management example in ChangesOpenCode delegation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
… from CodeRabbit, #809. The React 19 section cited BandProfilePage as using both <Helmet> and a direct document.title assignment. This PR removes that page's <Helmet> entirely, so the example contradicts the code the moment it merges. Moved to EventRecapPage (verified: 2 <Helmet> refs, 3 document.title), and recorded why BandProfilePage stopped qualifying so the next reader does not re-add a Helmet there thinking the doc is stale. Note this line was accurate on main -- it only goes false with this change, which is why it belongs in this commit rather than a follow-up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vm4Bw59Ntm1a9c7cPRsZe5
There was a problem hiding this comment.
Pull request overview
Updates OpenCode configuration defaults to use authenticated opencode-go/* models and removes a plugin that is not available, while documenting an OpenCode delegation contract in CLAUDE.md so future delegated runs are consistent and unblocked.
Changes:
- Point
opencode.jsondefaultmodel/small_modelatopencode-go/*models instead of unauthenticatedanthropic/*. - Remove
opencode-snipfrom the configured plugin list. - Add a “Delegating to OpenCode” section to
CLAUDE.mddocumenting the relay-based workflow and constraints.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
opencode.json |
Switch default model settings to authenticated opencode-go/* and remove the missing opencode-snip plugin. |
CLAUDE.md |
Document OpenCode delegation workflow/contract and operational rules for using the relay and models. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…rom three runs Go is $10/month flat but capped in USAGE DOLLARS ($12 per 5 hours, $30/week, $60/month), so model choice buys throughput, not just cost. At $2.14/run the 5-hour cap allows ~5 delegations; at $0.125 it allows ~96. deepseek-v4-pro measured 5x CHEAPER than glm-5.2 on a smaller task, which inverts the naive read of a "pro" tier -- cost tracks tokens consumed, and so how much the model explores, not its rate card. Default moves to deepseek-v4-pro, with an instruction to read result.json's cost field each run. Says plainly that three runs is not a ranking, so the next reader does not treat the unlisted 15 models as ruled out.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@CLAUDE.md`:
- Line 75: Update the `opencode run` guidance in `CLAUDE.md` to state that
headless runs without `--auto` reject `ask` permission requests rather than
blocking indefinitely. Preserve the recommendation to use `relay.mjs` and
explain its `--auto` behavior accurately.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c76142b7-219b-4c14-a8dc-df18fe52c59d
📒 Files selected for processing (2)
CLAUDE.mdopencode.json
…al prerequisite Two review findings on #810, both valid. The --auto rule was WRONG. I wrote that a raw `opencode run` blocks forever on a permission prompt because opencode.json sets edit/bash/read/task to "ask". My own evidence contradicted that and I documented the rule anyway: the scratch write test (gemini-3.5-flash-lite, no --auto) edited a file in 12s, so permissions never blocked it. OpenCode auto-approves by default; --auto is explicit belt-and-braces, not load-bearing. The relay still earns "always", for reasons that ARE load-bearing: it feeds the brief over stdin (argv hangs above ~1.5KB, measured), it writes result.json with cost/touchedFiles/session id, and it never commits. A raw run gives up all three. Second: CLAUDE.md pointed at `.agents/skills/` and `relay.mjs` as if they lived here. They do not -- .agents/ is gitignored (line 59), so a fresh clone has neither and `git ls-files` shows no relay.mjs. Now stated as an external prerequisite with the install command and the CLI/auth requirements. make gate green: 1119 backend + 1000 frontend.
Summary
Points
opencode.jsonat models that actually exist on this account, drops a plugin that errors on every run, and writes down the delegation contract.The bug
The config named a provider this account is not authenticated to and that carries zero models. Any run falling back to the config default failed outright — the file predates the Zen/Go subscriptions. Verified fixed: a bare
opencode runnow answers where it previously could not resolve a provider.Also removes
opencode-snip: its binary is not onPATH, so it loggedsnip binary not found in PATH — plugin disabledon every single run.The contract, in CLAUDE.md
Four rules, each attached to the thing that broke while establishing them:
opencode run.opencode.jsonsetsedit/bash/read/tasktoask; a headless run without the relay's--autoblocks forever on a prompt nobody can answer.--modelalways, fromopencode-go/*. That is the flat-rate subscription.opencode/*is Zen and is metered per token.opencode.jsonis the tooling surface — it hands OpenCode ourCLAUDE.mdplus 17 instruction files, 6 MCP servers, four agents and five commands. That is why a delegated diff can honour invariants the brief never restated.Cost data (measured, 3 runs)
glm-5.2deepseek-v4-proglm-5.2OpenCode Go is $10/month flat but capped in usage dollars: $12 per 5 hours, $30/week, $60/month. At $2.14/run that is ~5 runs per window; at $0.125 it is ~96. Model choice is a throughput decision, not just a cost one.
deepseek-v4-probeing 5× cheaper thanglm-5.2inverts the naive "pro tier = expensive" assumption, so CLAUDE.md states plainly that only these three runs are measured rather than implying a ranking.Test plan
make gategreen — 1119 backend + 1000 frontend, lint, format, buildopencode.jsonparses as valid JSONopencode runsmoke-tested end to end: returnsCONFIG-OKviaglm-5.2command -v snipconfirms the removed plugin's binary is genuinely absentNotes
Config only — no application code touched.
Built by Theo · 🤖 Claude Code
Summary by CodeRabbit
Documentation
Configuration