Skip to content

fix(workspace-sleep): show slept terminals as closed - #869

Merged
leynier merged 2 commits into
mainfrom
fix/workspace-sleep-shows-closed-terminals
Sep 25, 2026
Merged

leynier merged 2 commits into
mainfrom
fix/workspace-sleep-shows-closed-terminals

Conversation

@leynier

@leynier leynier commented Sep 25, 2026

Copy link
Copy Markdown
Owner

What changed

  • Sleep now preserves tab records and workbench layout and records the terminal tabs it stopped. The runtime stores them as workspace.sleptTabs and clears the record when a session starts again for one of them.
  • Added additive workspaceSleepStateV1 capability with workspace.sleptTabs verb and workspaceSleepChanged event.
  • Sidebar snapshot drops slept terminals from terminal counts and agent presence, exposes sleptTabIdsByWorkspaceId, and only subtracts live records so a slept tab closed later does not hide new terminals.
  • Host wakes the whole workspace on terminal spawn for a slept tab, records sleep on workspace.sleep, and broadcasts sleep changes.
  • Desktop WorkbenchState adds sleptTabIdsByWorkspaceId with awakeTabsFor() for sidebar rows, attention, activity, and active filtering. WorkbenchController watches the host list and sets it optimistically on sleep so rows update before the snapshot arrives.
  • RuntimeWorkbenchRepository implements new WorkspaceSleepRepository via workspace.sleptTabs, gated by capability check.
  • Mobile workspace list refreshes on workspaceSleepChanged.
  • Updated docs/architecture.md and docs/workspace-storage.md to describe sleep as visible but listed as closed.

Why

  • A slept workspace should list like one whose terminals were closed until it is opened again, while keeping tab records so agent sessions resume through stored native session ids.
  • A terminal created after sleep, such as a CLI-spawned agent, should still show as running, and sleep or wake from any client should reach desktop and mobile sidebar counts.

- keep tab records and layout on sleep for agent resume while
  listing the workspace like its terminals were closed
- track stopped terminals via `workspace.sleptTabs` and
  `workspaceSleepChanged` under `workspaceSleepStateV1`
- clear slept state when a slept tab starts again so post-sleep
  terminals still show as running

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Sleep now records the terminal tabs it stopped so desktop and mobile list a slept workspace as if those terminals were closed, until a slept tab starts again.

  • Runtime sleep overlay record_workspace_sleep stores terminal tab ids in runtime metadata, wake_workspace_for_tab clears the whole workspace when one of those tabs starts, and a tab created after sleep leaves the others asleep.
  • Additive protocol workspaceSleepStateV1 gates workspace.sleptTabs and workspaceSleepChanged without a version bump, advertised in the control file, status.get, and the Dart capability const.
  • Sidebar snapshot Host counts and agent presence drop only live slept terminal records, and the snapshot exposes sleptTabIdsByWorkspaceId.
  • Desktop listing awakeTabsFor() drives sidebar rows, attention, activity, and the active filter; the controller watches the host list and applies the same ids optimistically on local sleep.
  • Mobile list Workspace list refreshes on workspaceSleepChanged and uses the host-adjusted snapshot counts; it does not need the new verb or hello capability.
  • Coverage Store, snapshot, hide-slept, host conformance, desktop listing/controller, and mobile event tests pin the overlay and the post-sleep spawn path.

Pullfrog  | View workflow run | Using Grok | 𝕏

@leynier
leynier merged commit cd73ef4 into main Sep 25, 2026
22 of 23 checks passed
@leynier
leynier deleted the fix/workspace-sleep-shows-closed-terminals branch September 25, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant