feat: prepare Zhinian desktop client for pilot release

This commit is contained in:
inman
2026-04-29 10:23:20 +08:00
parent f9361e686a
commit 47b83b79fc
149 changed files with 15341 additions and 3590 deletions

View File

@@ -1112,7 +1112,26 @@ export function listConfiguredChannelAccountsFromConfig(config: OpenClawConfig):
const accounts = getChannelAccountsMap(section);
const accountIds = accounts
? Object.keys(accounts).filter((accountId) => accountId.trim().length > 0)
? Object.keys(accounts).filter((accountId) => {
if (!accountId.trim()) return false;
if (channelType !== 'agentbus' || accountId !== DEFAULT_ACCOUNT_ID) return true;
const configuredDefault = typeof section.defaultAccount === 'string' ? section.defaultAccount.trim() : '';
const accountConfig = accounts[accountId];
// AgentBus stores legacy top-level connection fields and may mirror a
// partial `accounts.default` object during generic edits. Treat that
// mirror as display/routing noise unless it is explicitly the default
// account and contains the fields a real AgentBus account needs.
if (configuredDefault && configuredDefault !== DEFAULT_ACCOUNT_ID) return false;
return Boolean(
accountConfig
&& typeof accountConfig.id === 'string'
&& accountConfig.id.trim()
&& typeof accountConfig.agentId === 'string'
&& accountConfig.agentId.trim()
&& typeof accountConfig.wsUrl === 'string'
&& accountConfig.wsUrl.trim(),
);
})
: [];
let defaultAccountId = typeof section.defaultAccount === 'string' && section.defaultAccount.trim()