fix(channels): preserve single-account setup labels (#111134)

Fixes #111130
This commit is contained in:
Peter Steinberger
2026-07-18 19:32:31 -07:00
committed by GitHub
parent 5bb969f7de
commit 075030c19e

View File

@@ -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,