fix: restore heartbeat defaults and model listing
This commit is contained in:
@@ -238,13 +238,24 @@ function listExistingAgentIdsFromDisk(): string[] {
|
||||
}
|
||||
|
||||
function listConfiguredAgentIds(cfg: ClawdbotConfig): string[] {
|
||||
const agents = cfg.agents?.list ?? [];
|
||||
if (agents.length > 0) {
|
||||
const ids = new Set<string>();
|
||||
for (const entry of agents) {
|
||||
if (entry?.id) ids.add(normalizeAgentId(entry.id));
|
||||
}
|
||||
const defaultId = normalizeAgentId(resolveDefaultAgentId(cfg));
|
||||
ids.add(defaultId);
|
||||
const sorted = Array.from(ids).filter(Boolean);
|
||||
sorted.sort((a, b) => a.localeCompare(b));
|
||||
return sorted.includes(defaultId)
|
||||
? [defaultId, ...sorted.filter((id) => id !== defaultId)]
|
||||
: sorted;
|
||||
}
|
||||
|
||||
const ids = new Set<string>();
|
||||
const defaultId = normalizeAgentId(resolveDefaultAgentId(cfg));
|
||||
ids.add(defaultId);
|
||||
const agents = cfg.agents?.list ?? [];
|
||||
for (const entry of agents) {
|
||||
if (entry?.id) ids.add(normalizeAgentId(entry.id));
|
||||
}
|
||||
for (const id of listExistingAgentIdsFromDisk()) ids.add(id);
|
||||
const sorted = Array.from(ids).filter(Boolean);
|
||||
sorted.sort((a, b) => a.localeCompare(b));
|
||||
|
||||
Reference in New Issue
Block a user