fix(sessions): guard, gate, and test session reload

Build on the original Reload action with the fixes raised in review:

- Server reload() now refuses to run on archived (read-only) sessions
  and when the session has work in progress, mirroring archive(), so a
  reload can no longer silently abort an in-flight agent run.
- Add a sessions.reload runtime capability; the client gates both the
  reloadSession call and the Reload menu entry on it so the action only
  appears for machines whose Pi-Web runtime supports it.
- reloadSession ignores cached-new and archived sessions.
- Add server (PiSessionService + routes) and client (SessionController)
  tests covering reload success, the active-work guard, archived
  rejection, route forwarding, capability gating, and error mapping.
- Restore alphabetical parser import ordering in clients.ts.
- Add a changeset documenting the feature and the sessiond restart note.

Note: touches a session daemon code path, so pi-web-sessiond.service
must be restarted manually for the server side to take effect.
This commit is contained in:
Federico Jaramillo Martinez
2026-06-14 14:17:51 +02:00
parent ea1ec1b595
commit 82db15f894
12 changed files with 218 additions and 8 deletions
+1
View File
@@ -3,6 +3,7 @@ export type MachineStatus = "unknown" | "online" | "offline" | "error";
export const PI_WEB_CAPABILITIES = {
sessionsDeleteArchived: "sessions.deleteArchived",
sessionsReload: "sessions.reload",
promptAttachments: "prompt.attachments",
} as const;