feat(dashboard,core): show completed planning sessions and add archive

Planning sidebar's `/api/ai-sessions` listing filtered out `complete`
rows, so a session that finished while the modal was closed disappeared
on refresh even though the result was still in SQLite. Add
`?includeCompleted` / `?includeArchived` flags and a new `archived`
column (migration 57) so users can hide terminal sessions on demand
without deleting them; only `complete`/`error` rows are archivable so
live agents can't be orphaned.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-01 10:36:39 -07:00
parent 3b43630fa1
commit 56210e0712
7 changed files with 325 additions and 29 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": minor
---
Planning sidebar now lists every saved planning session, not just active ones, so a session that finishes while the modal is closed remains selectable on refresh — previously the `/api/ai-sessions` listing filtered out `complete` rows and they vanished from the UI even though the result was still in SQLite. Adds the ability to archive and unarchive completed (or errored) planning sessions: a per-row archive button hides terminal sessions from the sidebar, and a "Show archived" toggle reveals them for unarchive. Backed by a new `ai_sessions.archived` column (migration 57), `POST /api/ai-sessions/:id/archive` and `/unarchive` endpoints (only terminal sessions are archivable so live agents can't be orphaned), and `?includeCompleted` / `?includeArchived` query flags on `GET /api/ai-sessions`. Existing consumers (`useBackgroundSessions`, `MissionManager`) are unchanged — they continue to see only active/retryable sessions.