fix: restore heartbeat defaults and model listing

This commit is contained in:
Peter Steinberger
2026-01-12 17:13:24 +00:00
parent f1dd59bf82
commit 355c13564c
7 changed files with 841 additions and 81 deletions

View File

@@ -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));