mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-07 03:34:20 +08:00
fix(opencode): skip reading live config when editing provider
OpenCode's read_live_settings returns the full opencode.json file instead of just the provider fragment. This caused the edit dialog to save the complete config structure as settingsConfig, creating nested provider configurations. For OpenCode's additive mode, use DB config directly since each provider's config is stored independently.
This commit is contained in:
@@ -62,6 +62,17 @@ export function EditProviderDialog({
|
||||
return;
|
||||
}
|
||||
|
||||
// OpenCode uses additive mode - each provider's config is stored independently in DB
|
||||
// Reading live config would return the full opencode.json (with $schema, provider, mcp etc.)
|
||||
// instead of just the provider fragment, causing incorrect nested structure on save
|
||||
if (appId === "opencode") {
|
||||
if (!cancelled) {
|
||||
setLiveSettings(null);
|
||||
setHasLoadedLive(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const currentId = await providersApi.getCurrent(appId);
|
||||
if (currentId && provider.id === currentId) {
|
||||
|
||||
Reference in New Issue
Block a user