feat(opencode): support separate Zen and Go API key env vars#87762
feat(opencode): support separate Zen and Go API key env vars#87762olisikh wants to merge 5 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 29, 2026, 7:00 PM ET / 23:00 UTC. Summary PR surface: Source +2, Tests +35, Docs +7. Total +44 across 15 files. Reproducibility: yes. for the review findings by source inspection: current main writes both OpenCode profiles and the PR removes that fan-out, while AuthStorage still falls back through a map that only knows OPENCODE_API_KEY. No live runtime reproduction was run because this was a read-only review. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the split provider-specific env vars, but preserve or explicitly migrate shared OPENCODE_API_KEY profile fan-out and update every auth lookup path before asking maintainers to accept the new behavior. Do we have a high-confidence way to reproduce the issue? Yes for the review findings by source inspection: current main writes both OpenCode profiles and the PR removes that fan-out, while AuthStorage still falls back through a map that only knows OPENCODE_API_KEY. No live runtime reproduction was run because this was a read-only review. Is this the best way to solve the issue? No. Split keys are a reasonable direction, but the best solution needs backward-compatible shared-key profile behavior, complete auth lookup coverage, and runtime proof before changing docs and defaults. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 0e6937cc1be1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +35, Docs +7. Total +44 across 15 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
… docs - Add OPENCODE_GO_API_KEY to test mock candidate map for opencode-go so the new split-key precedence test actually passes - Restore setup.providers[].envVars in both opencode plugin manifests, keeping providerAuthEnvVars too (deprecated compat metadata) - Update opencode-go.md, model-providers.md, wizard-cli-reference.md, wizard-cli-automation.md, wizard.md, testing-live.md, config-tools.md to document OPENCODE_GO_API_KEY alongside the existing keys
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Command router queued. I will update this comment with the next step. |
Summary
OPENCODE_ZEN_API_KEY,OPENCODE_GO_API_KEY, and sharedOPENCODE_API_KEYReal behavior proof
Behavior or issue addressed: OpenCode Zen and Go can be configured independently while retaining shared
OPENCODE_API_KEYfallback behavior.Real environment tested: macOS checkout of this PR branch, Node/pnpm repo toolchain, dependencies installed from the lockfile.
Exact steps or command run after this patch:
node --import tsx -e 'const load=async(path)=>{const plugin=(await import(path)).default; const providers=[]; plugin.register({registerProvider:(p)=>providers.push(p),registerMediaUnderstandingProvider:()=>{}}); return providers[0];}; const zen=await load("./extensions/opencode/index.ts"); const go=await load("./extensions/opencode-go/index.ts"); console.log(JSON.stringify({zen:{provider:zen.id,envVars:zen.envVars},go:{provider:go.id,envVars:go.envVars}},null,2));' pnpm check:docsEvidence after fix:
Observed result after fix: the runtime plugin registrations expose separate Zen and Go env vars with shared fallback ordering; the OpenCode Go provider page no longer has the markdown table formatting drift that caused this PR's docs failure.
What was not tested: no live OpenCode API call was run because this environment has no OpenCode key available; the remaining docs glossary failure is unrelated to this PR's changed files.
Verification