From 075030c19eb288aa8edef9a80cf073481808cbce Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 18 Jul 2026 19:32:31 -0700 Subject: [PATCH] fix(channels): preserve single-account setup labels (#111134) Fixes #111130 --- src/channels/plugins/setup-wizard.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/channels/plugins/setup-wizard.ts b/src/channels/plugins/setup-wizard.ts index 86207918fb05..7738d7b719b5 100644 --- a/src/channels/plugins/setup-wizard.ts +++ b/src/channels/plugins/setup-wizard.ts @@ -267,11 +267,21 @@ export function buildChannelSetupWizardAdapterFromSetupWizard(params: { defaultAccountId, })); - const accountScope = createWizardAccountScope({ - cfg, - channelKey: plugin.id, - accountId, - }); + const channel = getChannelSection(cfg, plugin.id); + // Wizards that explicitly own account selection may use defaultAccount as a + // top-level routing label. Only inject temporary scope when generic selection + // owns the account or an accounts map proves that scoped storage is in use. + const shouldScopeAccount = + wizard.resolveShouldPromptAccountIds === undefined || + resolvedShouldPromptAccountIds || + channel.accounts !== undefined; + const accountScope = shouldScopeAccount + ? createWizardAccountScope({ + cfg, + channelKey: plugin.id, + accountId, + }) + : { cfg, restore: (currentCfg: OpenClawConfig) => currentCfg }; let next = accountScope.cfg; let credentialValues = collectCredentialValues({ wizard,