From 42a92c712a389d866042c9eaafc0a92b4db474a2 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 17 Jan 2026 11:34:39 +0800 Subject: [PATCH] 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. --- src/components/providers/EditProviderDialog.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/providers/EditProviderDialog.tsx b/src/components/providers/EditProviderDialog.tsx index 4f2ea4882..100d413d2 100644 --- a/src/components/providers/EditProviderDialog.tsx +++ b/src/components/providers/EditProviderDialog.tsx @@ -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) {