Skip to content

Detect and surface missing session workspaces#253

Merged
jongio merged 1 commit into
mainfrom
idea/missing-workspace
Jul 7, 2026
Merged

Detect and surface missing session workspaces#253
jongio merged 1 commit into
mainfrom
idea/missing-workspace

Conversation

@jongio

@jongio jongio commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Surface sessions whose working directory no longer exists on disk, and stop launches from starting a terminal in a path that is gone.

This happens often with git worktrees: you remove a worktree, but the session that pointed at it stays in the list. Selecting it and pressing Enter used to try to start a shell in a directory that no longer exists.

Closes #184.

Changes

  • Filter row: added a "Missing workspace" row to the session status filter picker (next to "Git changes"), with a live count. Toggle it to show only sessions whose folder is gone.
  • Preview badge: the detail preview now shows a Workspace: Missing line for the selected session when its folder no longer exists.
  • Launch guard:
    • Single launch (Enter) is blocked with the message Cannot launch: workspace folder no longer exists.
    • Batch launch skips missing sessions and reports Skipped N session(s): workspace folder no longer exists, so the rest still open.

All four surfaces read the existing async git-state scan (GitStateMissing), which already powers the session-list badge. That keeps everything consistent and means the state refreshes on reload. Sessions with an empty working directory are treated as present, so folder-only launches are unaffected.

Tests

  • Picker: default-off, toggle, accessors, HasSelection, count, and view rendering for the new row.
  • Model: sessionWorkspaceMissing, missingWorkspaceSessionCount, filterMissingWorkspaceSessions/Groups, and the launch guards (single blocked, present allowed, empty cwd allowed, batch skip count, all-missing returns nil).
  • Preview: the Workspace: Missing badge shows only when the flag is set.

Verification

  • go build ./...
  • go test ./... -count=1
  • go vet ./...
  • golangci-lint run (v2.12.2)

All pass.

Sessions whose working directory no longer exists on disk (for example
after a git worktree is removed) are now surfaced across the TUI:

- Add a 'Missing workspace' row to the session status filter picker so
  users can isolate sessions with a removed working directory.
- Show a 'Workspace: Missing' badge in the preview panel for the
  selected session.
- Guard launches: single launch reports an error and batch launch skips
  missing sessions with a count, so opening a terminal never starts in a
  path that no longer exists.

The filter, count, preview badge, and launch guard all read the existing
async git-state scan (GitStateMissing), so the state refreshes on reload
and stays consistent with the session list badge.

Closes #184

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 7, 2026
@jongio jongio self-assigned this Jul 7, 2026
@jongio jongio mentioned this pull request Jul 7, 2026
5 tasks
@jongio
jongio merged commit 9b2919c into main Jul 7, 2026
2 checks passed
@jongio
jongio deleted the idea/missing-workspace branch July 7, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing workspace detection

1 participant