[aidan] feat/history-popover: add chat history and scheduled tasks run log tabs (#96)

This commit is contained in:
Aidan
2026-06-17 23:22:40 -07:00
committed by GitHub
parent a1090b8ba1
commit 5f45db08a0
6 changed files with 116 additions and 11 deletions
+10
View File
@@ -147,6 +147,16 @@ def list_runs(wid: str, limit: int = 50) -> list[WorkflowRun]:
return runs[-limit:][::-1]
def list_all_runs(limit: int = 200) -> list[WorkflowRun]:
if not _cache_loaded:
init()
flat: list[WorkflowRun] = []
for arr in _runs_cache.values():
flat.extend(arr)
flat.sort(key=lambda r: r.started_at, reverse=True)
return flat[:limit]
def record_run(run: WorkflowRun) -> WorkflowRun:
with _io_lock:
_ensure_dirs()
+8
View File
@@ -499,6 +499,14 @@ async def get_run_escalation(run_id: str):
return {"state": state}
@workflows.router.get("/runs/all")
async def list_all_runs(limit: int = 200):
"""Flat, newest-first log of every workflow run across all workflows.
Backs the dashboard History popover's Scheduled tasks tab."""
runs = storage.list_all_runs(limit=limit)
return {"runs": [r.model_dump(mode="json") for r in runs]}
@workflows.router.get("/{workflow_id}")
async def get_workflow(workflow_id: str):
wf = storage.get_workflow(workflow_id)