feat: prepare Zhinian desktop client for pilot release
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user