Skip to content

feat(cli): add a read-only --list-workspaces command showing the leased parallel workspaces with branch and state (#232)#233

Merged
qwen-code-dev-bot merged 1 commit into
mainfrom
issue/232-workspace-graph
Jul 23, 2026
Merged

feat(cli): add a read-only --list-workspaces command showing the leased parallel workspaces with branch and state (#232)#233
qwen-code-dev-bot merged 1 commit into
mainfrom
issue/232-workspace-graph

Conversation

@qwen-code-dev-bot

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in (--list-workspaces) read-only command that lists the leased parallel workspaces with their branch and state, decomposed from roadmap #39 (isolated parallel agents).

Provisioning (#50), integration (#228), and cancellation (#230) of parallel workspaces existed, but there was no single view of which leased workspaces exist and what state they are in, so operators had to inspect git worktrees by hand.

Design

  • src/worktree-lease.ts: new collectWorktreeGraph({ repo, worktreeRoot? }) (reusing the module's git/identity helpers) plus formatWorktreeGraph. It enumerates the worktrees under the lease worktree root via git worktree list --porcelain and reports each one's redacted path, branch, abbreviated head, and clean/dirty state, bounded (100 entries) and redacted (home paths collapsed). Strictly read-only; fails closed on a non-repository; an empty lease set is an empty graph, not an error.
  • src/index.ts: opt-in --list-workspaces wired as a read-only mode (JSON + text), exiting 0 on success and 2 on a usage error or non-repository target.

Testing

  • tests/unit/workspace-graph.test.ts (7 tests): empty graph, listing with branch/head/clean state, clean/dirty classification, no-mutation proof, non-repository refusal, and formatting (empty + populated).
  • tests/integration/workspace-graph.test.ts (3 tests): CLI lists two leased workspaces with correct clean/dirty state (JSON) read-only, reports an empty graph (text), and exits 2 on a non-repository target.

Gates: typecheck, build, unit (1654), integration (458 + desktop), smoke (51) all pass.

Closes #232

…ed parallel workspaces with branch and state (#232)

Provisioning (#50), integration (#228), and cancellation (#230) of parallel workspaces existed, but there was no single view of which leased workspaces exist and what state they are in, so operators had to inspect git worktrees by hand. Add collectWorktreeGraph plus an opt-in --list-workspaces command that enumerates the leased worktrees under the lease root and reports each one's redacted path, branch, abbreviated head, and clean/dirty state, bounded and available as JSON or text. Strictly read-only (never mutates), fails closed on a non-repository, and reports an empty graph (not an error) when there are no leases.
@qwen-code-dev-bot

Copy link
Copy Markdown
Owner Author

E2E verification

  • Repository: qwen-code-dev-bot/oh-my-cli
  • Pull request: #233
  • Commit: 1edeec6ee430f0db74ac90b15838495e2ccb9521
  • Evidence mode: terminal
  • Result: PASS
Scenario Command Exit Duration
integration npm run test:integration 0 29.82s
smoke npm run smoke 0 3.268s

E2E evidence

Full immutable report

@qwen-code-dev-bot
qwen-code-dev-bot merged commit bccd494 into main Jul 23, 2026
2 checks passed
@qwen-code-dev-bot
qwen-code-dev-bot deleted the issue/232-workspace-graph branch July 23, 2026 02:42
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.

Parallel observability: list the leased parallel workspaces (worktrees) with branch and state, bounded and redacted

1 participant