fix(server): restore workspace agents when unarchiving workspace

This commit is contained in:
Mohamed Boudra
2026-11-09 16:06:11 +01:00
parent e6fac1f592
commit c7b067c19b
18 changed files with 347 additions and 150 deletions
+7 -4
View File
@@ -257,7 +257,7 @@ Workspace archive is a separate lifecycle. Archiving or removing a worktree can
agent record without setting the agent's `archivedAt`, while its `workspaceId` still points at the
archived workspace. History navigation must not infer workspace lifecycle from `agent.archivedAt`
or mutate either lifecycle. The workspace route asks the daemon for authoritative recovery state;
only the route's explicit Unarchive or Restore action changes the archived workspace.
the route exposes explicit Unarchive and Restore actions.
Workspace archive is undoable from the archived toast, or with Cmd/Ctrl+Z, while the toast is up.
The daemon runs one archive lane per workspace, shared by every connection
@@ -281,9 +281,12 @@ does not flip it back. Tabs and layout are purged only once the undo window clos
archive committed.
History navigation opens the selected agent without changing either archive state. Workspace
**Restore** recovers only the workspace; the selected archived agent stays open with its callout.
The agent's **Unarchive** runs the provider's native unarchive hook before interactive resume and
history hydration. Other archived agents stay archived.
**Unarchive**, **Restore**, Undo, and reopening the directory recover the agents closed by that
workspace archive, including
after a daemon restart or after the toast expires. Agents archived individually beforehand stay
archived. A failed worktree recreation leaves the workspace and its agents archived for retry.
Each recovered agent runs the provider's native unarchive hook before interactive resume and
history hydration.
Opening an agent is a navigation choice, independent of whether its details are cached. The
layout retains that choice across reload while the panel fetches the agent from the daemon.