Models-first /model picker and OpenCode Go billing pin - #327
Merged
Conversation
Force the Go subscription base URL whenever opencodeGo is set so a mis-seeded or re-connected provider cannot store bare Zen PAYG. Connect re-seed always pins catalog URLs for Go and Zen. Surface subscription/credits product hints and a cross-product helper for Go models on Zen. Restructure first-class Connect as Tier A: dual-path OpenAI (ChatGPT browser login vs API key), drop separate Codex, add Z.AI Coding Plan and an explicit Custom entry last.
Persist global recentModels/favoriteModels with pure helpers, and build the ordered models-first picker list (Recent, Favorites, providers).
Default the agent modal to Recent/Favorites/Providers, collect only the API key on first-class connect, and persist recent/favorite pairs from the provider manager.
Keep the optional-key no-drop guard green after adding models-first picker preferences to global settings.
Skip success toast when the message is empty (recent/favorite silent saves). Drop modal-side onRecordRecent so applySelection is the single writer for recent models.
Serialize recent/favorite disk writes with an absolute in-memory list so concurrent Alt+F and apply cannot clobber each other. Pin Go base URL when the provider id is opencode-go even without the flag. Esc from connect and profiles returns to the step that opened them. Drop the billingProductHint alias and drive the connect list through connectListProviders.
Centralize Go detection on id and display name so Connect-seeded "OpenCode Go" rows pin the same as opencode-go. Heal bare Zen baseURLs on catalog load and settings projection so runtime never trusts a mis-seeded Go base URL for billing.
Force OPENCODE_GO_BASE_URL in resolveProvider so emergency fallback cannot mis-bill. Route agent-modal seed, status-bar usage, and gateway error classification through the shared identity helpers, and unit-test them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/modelon a models-first list (Recent / Favorites / Providers) with Alt+A connect, Alt+F favorite, and auth-only API-key form (CL-5355).recentModels/favoriteModelsin global settings; wire through provider manager and modal stack.Test plan
bun run typechecktests/unit/tui/app.test.tsx(19 pass)/modelopens on model list; Alt+A connect API-key provider; Alt+F favorite; apply updates Recenthttps://opencode.ai/zen/go/v1and is not billed as Zen PAYGCloses CL-5355
Closes CL-5356