Skip to content

chore(opencode): point config at authenticated models, document the delegation contract - #810

Merged
BreakableHoodie merged 4 commits into
mainfrom
chore/opencode-delegation-config
Aug 12, 2026
Merged

chore(opencode): point config at authenticated models, document the delegation contract#810
BreakableHoodie merged 4 commits into
mainfrom
chore/opencode-delegation-config

Conversation

@BreakableHoodie

@BreakableHoodie BreakableHoodie commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Points opencode.json at models that actually exist on this account, drops a plugin that errors on every run, and writes down the delegation contract.

The bug

config model:       anthropic/claude-sonnet-4-5
config small_model: anthropic/claude-haiku-4-5

authenticated providers:      OpenCode Zen, OpenCode Go
anthropic/ models in catalog: 0

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 run now answers where it previously could not resolve a provider.

Also removes opencode-snip: its binary is not on PATH, so it logged snip binary not found in PATH — plugin disabled on every single run.

The contract, in CLAUDE.md

Four rules, each attached to the thing that broke while establishing them:

  1. Relay only, never a raw opencode run. opencode.json sets edit/bash/read/task to ask; a headless run without the relay's --auto blocks forever on a prompt nobody can answer.
  2. --model always, from opencode-go/*. That is the flat-rate subscription. opencode/* is Zen and is metered per token.
  3. Brief via file, never argv. ~1.5 KB of argv hung past 180s; the identical text attached as a file returned in 11s. The relay feeds stdin for exactly this reason.
  4. opencode.json is the tooling surface — it hands OpenCode our CLAUDE.md plus 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)

Task Model Cost
#797 — delete one meta tag glm-5.2 $0.65
#766 — schema loader deepseek-v4-pro $0.125
#766 — 14 fixture fixes glm-5.2 $2.14

OpenCode 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-pro being 5× cheaper than glm-5.2 inverts 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 gate green — 1119 backend + 1000 frontend, lint, format, build
  • opencode.json parses as valid JSON
  • Bare opencode run smoke-tested end to end: returns CONFIG-OK via glm-5.2
  • command -v snip confirms the removed plugin's binary is genuinely absent

Notes

Config only — no application code touched.

Built by Theo · 🤖 Claude Code

Summary by CodeRabbit

  • Documentation

    • Expanded OpenCode delegation guidance with relay-only execution, model selection, file-based briefs, tooling requirements, provider configuration, cost information, and a default model.
    • Updated the React 19 title-management example and documented the removal of Helmet usage from the band profile page.
  • Configuration

    • Updated the default and lightweight model selections.
    • Removed the OpenCode Snip integration from the configured plugins.

…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
@BreakableHoodie BreakableHoodie added priority:p2 Medium priority chore Maintenance, tooling, repo hygiene labels Aug 12, 2026
Copilot AI lite review requested due to automatic review settings August 12, 2026 18:34
@BreakableHoodie BreakableHoodie added priority:p2 Medium priority chore Maintenance, tooling, repo hygiene labels Aug 12, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d057048d-b7b2-4b51-a805-6c6f84fe52de

📥 Commits

Reviewing files that changed from the base of the PR and between c926453 and 08244a5.

📒 Files selected for processing (1)
  • CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CLAUDE.md

📝 Walkthrough

Walkthrough

The change updates OpenCode model and plugin settings. It adds delegation workflow guidance and updates the React 19 title-management example in CLAUDE.md.

Changes

OpenCode delegation

Layer / File(s) Summary
OpenCode runtime settings
opencode.json
The primary model changes to opencode-go/glm-5.2. The small model changes to opencode-go/deepseek-v4-flash. The opencode-snip plugin is removed.
Delegation workflow and React 19 guidance
CLAUDE.md
The document adds relay usage, explicit model selection, file-based briefs, tooling configuration, provider authentication requirements, cost data, usage caps, verification steps, and a default model. The React 19 example now references EventRecapPage.jsx and documents the removal of Helmet usage from BandProfilePage.jsx.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the changes and verification, but it omits the required Security / correctness notes and leaves the Closes # field incomplete. Add the issue number after Closes # and add a Security / correctness notes section with None or the applicable security and correctness impacts.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required chore prefix and clearly describes the OpenCode configuration and delegation documentation changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Schema Drift ✅ Passed No files under migrations/ changed in origin/main..HEAD, so the conditional requirement to update database/setup-complete.sql is not triggered.
Csp Hash Drift ✅ Passed The PR changes only CLAUDE.md and opencode.json; frontend/index.html and frontend/public/_headers are unchanged, and the current SHA-256 hash matches.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/opencode-delegation-config

Comment @coderabbitai help to get the list of available commands.

… 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

Copilot AI 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.

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.json default model/small_model at opencode-go/* models instead of unauthenticated anthropic/*.
  • Remove opencode-snip from the configured plugin list.
  • Add a “Delegating to OpenCode” section to CLAUDE.md documenting 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.

Comment thread CLAUDE.md Outdated
…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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 56292db and 672da97.

📒 Files selected for processing (2)
  • CLAUDE.md
  • opencode.json

Comment thread CLAUDE.md Outdated
…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.
@BreakableHoodie
BreakableHoodie merged commit 6aff429 into main Aug 12, 2026
22 checks passed
@BreakableHoodie
BreakableHoodie deleted the chore/opencode-delegation-config branch August 12, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, tooling, repo hygiene priority:p2 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants