chore(fleet): sync operator memory, hatch menu dialogs, and watchdog alerts

This commit is contained in:
operator
2026-10-07 00:25:51 +00:00
parent 0065d11e97
commit 34b0ef9fe2
38 changed files with 2205 additions and 444 deletions
+15 -1
View File
@@ -131,12 +131,19 @@ def parse_threads_blob(blob):
def normalize_thread(t):
is_main = (
t.get("thread") is False or
t.get("is_main") is True or
(t.get("title") and t.get("title").lower() in ("main chat", "main", "start conversation with muse"))
)
return {
"thread_id": t.get("session_id") or t.get("thread_id") or t.get("id"),
"title": t.get("title"),
"pinned": bool(t.get("pinned")),
"archived": bool(t.get("archived")),
"updated": t.get("updated"),
"thread": t.get("thread", True),
"is_main": is_main,
}
@@ -146,7 +153,14 @@ def cmd_list(agent):
code, error, detail, ec = map_failure(rc, err)
fail(code, error, detail=detail, exit_code=ec)
threads = [normalize_thread(t) for t in parse_threads_blob(out)]
print(json.dumps({"ok": True, "agent": agent, "threads": threads}))
mains = [t for t in threads if t.get("is_main")]
pinned = [t for t in threads if t.get("pinned") and not t.get("is_main")]
regular = [t for t in threads if not t.get("is_main") and not t.get("pinned")]
mains.sort(key=lambda t: t.get("updated") or "", reverse=True)
pinned.sort(key=lambda t: t.get("updated") or "", reverse=True)
regular.sort(key=lambda t: t.get("updated") or "", reverse=True)
sorted_threads = mains + pinned + regular
print(json.dumps({"ok": True, "agent": agent, "threads": sorted_threads}))
def cmd_mutate(agent, op, thread_id, title=None):