Skip to content

feat(launcher): offer OpenCode Zen and Go in the onboarding wizard - #1219

Open
mari0rh wants to merge 3 commits into
BitterSecurity:mainfrom
mari0rh:feat/onboard-opencode-plan
Open

mari0rh wants to merge 3 commits into
BitterSecurity:mainfrom
mari0rh:feat/onboard-opencode-plan

Conversation

@mari0rh

@mari0rh mari0rh commented Dec 1, 2026 •

Copy link
Copy Markdown

Summary

Adds OpenCode to the decepticon onboard wizard, which previously offered no OpenCode entry at all — neither plan. Both plans share one key: a Go subscriber had no correct choice in the wizard, so pointing "Custom OpenAI Endpoint" at the Zen base (or setting OPENCODE_API_KEY in .env) billed the credit balance instead of the monthly Go plan, with no error from either side.

Changes

  • Two adjacent options in the provider list: OpenCode Zen (pay-as-you-go credits) writes OPENCODE_API_KEY; OpenCode Go (monthly subscription) writes OPENCODE_GO_API_KEY.
  • Each gets its own key input with placeholder and description that names the billing difference.
  • Both join DECEPTICON_AUTH_PRIORITY through methodOrder, so the selected plan leads the fallback chain.

Intent

  • Issue / ADR this satisfies: the wizard follow-up named in feat(llm): add OpenCode Go OpenAI-compatible gateway #1218 (the OpenCode Go gateway). No ADR: same form pattern as the existing providers.
  • Anti-goal (one thing this PR could have done but deliberately does not): it does not add the other nine OpenAI-compatible gateways (Vercel, HF, Venice, NanoGPT, Synthetic, ZenMux, Qianfan, Cloudflare, Cheaper Inference) to the wizard, and it does not change the Zen/Go backend split.

Blast radius

  • Tier-delegate — launcher UI.
  • Tier-auto, Tier-supply-chain

No workflow, manifest, install script, compose file, Dockerfile, contract or semgrep change.

Diff budget

  • My diff fits the budget. Three files, of which one is the runtime surface (clients/launcher/cmd/onboard.go, ~50 lines); the other two are its test (clients/launcher/cmd/onboard_opencode_test.go) and the CHAGELOG.md entry, both excluded from the runtime budget. One logical concern: make the billing plan explicit at install time.

End-to-end verification

Run in WSL2 Ubuntu with Go 1.24.5 on the branch head:

  • gofmt -l clients/launcher/cmd/onboard.go clients/launcher/cmd/onboard_opencode_test.go → no output.
  • go vet ./... in clients/launcher → exit 0.
  • go test ./cmd/ -run "Opencode|MethodOrder" -v → 2 tests, 5 subtests, all PASS:
    • TestMethodOrderListsBothOpencodePlansOnceWithZenFirst — both entries present exactly once, Zen before Go (the priority list is what becomes DECEPTICON_AUTH_PRIORITY).
    • TestOpencodeEnvValuesSeparatesTheTwoBillingPlans — a Zen key writes only OPENCODE_API_KEY, a Go key writes only OPENCODE_GO_API_KEY, both keys stay in their own variable, blanks write nothing, surrounding whitespace is trimmed.
  • go test ./cmd/... full package → ok. go build -o bin/decepticon . → 25 MB binary.

Verified interactively on 2026-12-01 (WSL2 Ubuntu, launcher built from this branch, make dogfood, fresh DECEPTICON_HOME): the OpenCode Go entry renders in the provider selector, its key form accepts a value, and the completed wizard writes exactly

OPENCODE_GO_API_KEY=<value>

to .dogfood/.env — with no OPENCODE_API_KEY line. That is the data path this PR exists to fix: the plan the user picks decides the variable, so a Go subscriber can no longer land on the pay-as-you-go base.

Not covered by that run, and not claimed: selecting the OpenCode Zen entry (the sibling branch of the same form), and selecting both entries at once.

Testing

All gates run on this branch in WSL2 Ubuntu (Node 22.23.5, Go 1.24.5):

  • make quality passes (Python + CLI + Web) — its four targets, each exit 0: ci-lint (ruff, format, basedpyright 0 errors / 953 pre-existing warnings), ci-test (6262 passed, 14 skipped in 54.4s), quality-cli (294 tests in 40 files, plus npm audit, streaming build, typecheck and build), quality-telemetry (typecheck, tests, wrangler dry-run).
  • make smoke — not run for this branch. The diff touches only launcher UI code; the stack build/up/health is what feat(llm): add OpenCode Go OpenAI-compatible gateway #1218 exercised.
  • pytest tests/ passes — included in the ci-test selection above.
  • Launcher lane: go vet ./... exit 0 and go test ./... ok across cmd, internal/*.
  • Every new/changed test was watched to fail without the change: the two new tests reference methodOpencodeAPI / methodOpencodeGoAPI, which do not exist on main, so the package does not compile before this diff.
  • Every new/changed code path was executed on my machine — the form rendering, the submit path and the OPENCODE_GO_API_KEY write were run through the real wizard on 2026-12-01 (details above).

Quality Bar self-check

  • No banned pattern from QUALITY_BAR appears in the diff.
  • No AI-slop signature survives.
  • Every changed line traces to the stated intent.
  • No new public function without annotations (Go: named consts, no new exported API).
  • I would merge this PR if a stranger opened it.

Related Issues

Follow-up to #1218.

The wizard had no OpenCode entry for either plan, and both plans share one key
format. A Go subscriber therefore had to reach the Zen base, which bills the
credit balance instead of the monthly plan with no error. Two adjacent options
write OPENCODE_API_KEY and OPENCODE_GO_API_KEY so the plan is chosen explicitly.
Extracts opencodeEnvValues so the two billing plans can be asserted without
the TUI, and covers the methodOrder wiring: both entries present once, Zen
first, and each key landing in its own variable.

This branch has not been deployed

No deployments
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.

1 participant