feat(providers): add OpenCode Zen + Go to the model picker
Author: drmaasCreated Jul 25, 2026Updated Sep 26, 2026
Summary
OpenCode (opencode.ai/zen) offers a hosted model aggregator and a flat-rate subscription tier behind a SINGLE OpenCode API key. Today neither surfaces in the model picker, so users hand-rolling opencode_zen:<model> strings have to drop down to the matrix label fallback.
Proposed change
Add two new picker entries that route independently but share one secret:
opencode_zen(credit-tier frontier models: gpt-5.6, claude-fable-5, grok-4.5, gemini-3.1-pro-preview, glm-5.2, qwen3.7-max, deepseek-v4-pro, kimi-k3).opencode_go(flat-rate subscription tier: kimi-k3, kimi-k2.7-code, kimi-k2.6, minimax-m2.5, qwen3.7-plus, deepseek-v4-flash, glm-5.1).
Both reach the same OpenAI-compatible endpoint https://opencode.ai/zen/go/v1/ and bill under one OpenCode account.
Plumbing (mostly already done on feat/opencode-providers)
ProviderDescriptorgains akey_profile: Optional[str]field. Provider secrets flow throughprovider:<key_profile>instead of per provider.ProviderRouter._client_formergesprovider:<key_profile>(shared) +provider:<name>(own wins for non-secret fields) before invoking the build factory.ProviderRouter.invalidate(name)drops siblings sharing the samekey_profileso a shared-key change widens the cache wipe.SessionManager.set_providerwrites secrets to the shared profile; non-secrets stay per-provider;remove_providerdeletes both;verify_providerfalls back to shared;get_providerschecks both forconfigured._provider_configuredkeeps its semver: still returns True when either layer holds the key.
Acceptance criteria
- A user pastes the OpenCode key into either card once; BOTH cards immediately render
✓ Connected. - Curated model lists are distinct and non-overlapping except for the planned tier-shared model (kimi-k3).
Remove key…on either card disconnects BOTH.- Default model flow: first configured
opencode_zentakes over the default; a lateropencode_godoes NOT steal it. - Tests: 12 new tests in
tests/test_providers.pyandtests/test_provider_router.py. (Currently 4 pass at registry-level; 7 of the SessionManager-level tests hit a transitiveaisuite.agentsenv blocker — separate from this change.)
UX screenshots
Per CONTRIBUTING, PRs must include screenshots of the picker with both cards visible and the ✓ Connected state. Will attach when the PR is opened.
Source: andrewyng/openworker