fix: restore heartbeat defaults and model listing

This commit is contained in:
Peter Steinberger committed 2026-01-12 17:17:54 +00:00
1 parent f1dd59bf82
commit 355c13564c
7 files changed
+841 -81

No files matched your search

+15 -4
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));