fix(opencode settings): support opencode zen and go endpoints switching#262
Open
ShiboSheng wants to merge 1 commit into
Open
fix(opencode settings): support opencode zen and go endpoints switching#262ShiboSheng wants to merge 1 commit into
ShiboSheng wants to merge 1 commit into
Conversation
OpenCode keys could only discover the Go catalog by default and the Settings UI had no durable way to choose between Zen and Go. This made Zen subscriptions show the wrong model list and made switching endpoints require re-adding credentials. Add explicit OpenCode Zen/Go endpoint selection during setup, auto-detection, and inline account editing. Persist the selected endpoint as the account base URL, refresh endpoint-specific model lists, and keep OpenCode validation/provider defaults aligned with Zen while preserving Go as a selectable endpoint. Verification: - pnpm run lint: passed - pnpm run check:circular: failed due to pre-existing cycle api/tauri/session/index.ts > util/session/sessionDispatch.ts outside this diff - cargo clippy --all-targets -- -D warnings: failed due to pre-existing warnings outside changed files - pnpm exec eslint src/modules/MainApp/Integrations/KeyVault/hooks/useKeyVaultPage.ts src/modules/MainApp/Integrations/KeyVault/Accounts/Table/AccountInlineEditSection.tsx src/modules/MainApp/Integrations/KeyVault/Accounts/Table/AccountInlineExpandedCard.tsx src/modules/MainApp/Integrations/KeyVault/Accounts/Table/MyAccountsTableSection.tsx src/modules/MainApp/Integrations/KeyVault/Table/AccountsTable.tsx src/scaffold/WizardSystem/variants/KeyVault/hooks/useApiSetupTokenDetection.ts src/scaffold/WizardSystem/variants/KeyVault/components/KeySelectionModal.tsx src/scaffold/WizardSystem/variants/KeyVault/components/setup/GenericSetup.tsx: passed - cargo test -p key_vault opencode: passed - rustfmt --edition 2021 --check changed Rust files: passed Pre-commit hook ran. Total eslint: 0, total circular: 0
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
Fixes #260
Add explicit OpenCode Zen/Go endpoint support for key setup, auto-detection, and saved account editing.
Root Cause
OpenCode was treated as a single provider with a Go-biased default endpoint. The key validation path defaulted to OpenCode Go before Zen, and Settings did not expose a clear way to choose or switch between OpenCode Zen and OpenCode Go.
That caused Zen subscribers to see the wrong model catalog, and made endpoint switching require re-adding credentials.
Fix
opencodekeys can be checked against Zen or Go.opencode-gokeys are treated as Go-only.base_url.Screenshots
OpenCode endpoint selection in setup
OpenCode endpoint switching in existing account edit
Verification
pnpm run lint— passedpnpm run check:circular— failed due to pre-existing cycle outside this diff:api/tauri/session/index.ts > util/session/sessionDispatch.tscargo clippy --all-targets -- -D warnings— failed due to pre-existing warnings outside changed filespnpm exec eslint src/modules/MainApp/Integrations/KeyVault/hooks/useKeyVaultPage.ts src/modules/MainApp/Integrations/KeyVault/Accounts/Table/AccountInlineEditSection.tsx src/modules/MainApp/Integrations/KeyVault/Accounts/Table/AccountInlineExpandedCard.tsx src/modules/MainApp/Integrations/KeyVault/Accounts/Table/MyAccountsTableSection.tsx src/modules/MainApp/Integrations/KeyVault/Table/AccountsTable.tsx src/scaffold/WizardSystem/variants/KeyVault/hooks/useApiSetupTokenDetection.ts src/scaffold/WizardSystem/variants/KeyVault/components/KeySelectionModal.tsx src/scaffold/WizardSystem/variants/KeyVault/components/setup/GenericSetup.tsx— passedcargo test -p key_vault opencode— passedrustfmt --edition 2021 --check crates/key-vault/src/commands/validate.rs crates/key-vault/src/auto_detect/opencode.rs crates/key-vault/src/provider_config.rs crates/agent-core/src/core/providers/registry.rs— passed