feat(dev): run multiple concurrent lab instances per project #51

Merged
dominik.polakovics merged 1 commit from feat/lab-concurrent-instances into main 2026-05-27 13:53:42 +02:00

Implements #50 — run several claude --remote-control instances of the same project.

What changed

  • Index page groups live sessions under their project; idle projects still render so they can be restarted.
  • First/only instance keeps the bare project name (slot 1); extras are auto-numbered project~N, with an optional sanitized label rendered as project~N~label so tmux ls/attach are self-describing. Freed slot numbers are reused.
  • Per-instance Stop + per-project "Stop all", confined to the exact project via a separator-guarded prefix check (foo never catches foobar). Each instance keeps its own claude.ai deep link, forgotten on stop.
  • Global -max-instances cap (default 6) disables Start/New instance at the limit, enforced server-side too; the login session never counts.
  • Project recency ordering, deep-link capture, and the Claude login flow are preserved.

Tests

New instance_test.go exhaustively covers the slot/label/parse/belongsTo logic. New handler tests (against a private tmux -L server) cover grouping + slot order, the server-side cap guard with login excluded, Stop-all project confinement, and per-instance link forgetting. go build/vet/test all green locally.

Closes #50

Implements #50 — run several `claude --remote-control` instances of the same project. ## What changed - Index page groups live sessions under their project; idle projects still render so they can be restarted. - First/only instance keeps the bare project name (slot 1); extras are auto-numbered `project~N`, with an optional sanitized label rendered as `project~N~label` so `tmux ls`/`attach` are self-describing. Freed slot numbers are reused. - Per-instance Stop + per-project "Stop all", confined to the exact project via a separator-guarded prefix check (foo never catches foobar). Each instance keeps its own claude.ai deep link, forgotten on stop. - Global `-max-instances` cap (default 6) disables Start/New instance at the limit, enforced server-side too; the login session never counts. - Project recency ordering, deep-link capture, and the Claude login flow are preserved. ## Tests New `instance_test.go` exhaustively covers the slot/label/parse/`belongsTo` logic. New handler tests (against a private `tmux -L` server) cover grouping + slot order, the server-side cap guard with login excluded, Stop-all project confinement, and per-instance link forgetting. `go build`/`vet`/`test` all green locally. Closes #50
lab groups sessions by project on the index page and can run several claude --remote-control instances against the same checkout. The first/only instance keeps the bare project name (slot 1); extras are auto-numbered (project~N) with an optional sanitized label (project~N~label) that surfaces in tmux ls/attach. Freed slot numbers are reused.

Lifecycle is per-instance (Stop) plus a per-project Stop all, confined to the exact project via a separator-guarded prefix check so a sibling (foo vs foobar) is never caught; each instance keeps its own claude.ai deep link, forgotten when it stops. A global cap (-max-instances, default 6) bounds concurrent instances and disables Start/New instance at the limit; the login session never counts against it. Project recency ordering and the Claude login flow are unchanged.

Closes #50
dominik.polakovics deleted branch feat/lab-concurrent-instances 2026-05-27 13:53:42 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos!51
No description provided.