feat(sessions): per-workspace shell toggle for integration work #15

Manually merged
lz merged 1 commit from base-session into main 2026-05-16 19:10:14 +02:00
Owner

Why

Today each Nexus session is locked to its own per-session worktree at /workspace/.nexus/worktrees/<name> on a fresh branch. That's great for parallel feature work, but it leaves no place inside Nexus to do the integration work — merging finished session branches back into main and resolving the conflicts that fall out. The only way today is docker exec into the container by hand and run git there, outside of any Nexus session.

This PR closes that gap with the smallest viable surface: a single "Workspace shell" toggle on each workspace card.

What

  • Repurposes the entrypoint's existing idle boot tmux window — tmux respawn-windows it on demand so claude only runs there when an operator asks for it, no extra windows accumulate, and the window goes back to its initial-idle state when closed.
  • Launches claude --remote-control "<workspace>" rooted at /workspace (the real main-branch worktree) — the canonical place to do git merge, resolve conflicts, and push.
  • Toggle is idempotent: openWorkspaceSession leaves an in-flight claude untouched, and closeWorkspaceSession is a no-op when boot is already idle. The Close action is gated by a confirm(); conversation state is persisted to JSONL on disk so a stray click is recoverable.
  • Status is surfaced via a new workspaceShellRunning field on workerHealth (one extra tmux display-message per poll), which the UI uses to flip the button label/style.

What this PR deliberately does NOT do

  • No new DB rows, schema migrations, or DTO surfaces — the workspace shell is not a "session" in the DB sense, by design.
  • No cross-session conflict detection, dry-run merges, Forgejo PR enrichment, or landing queue. The earlier brainstorm proposed all of those; this PR ships only the integration-shell primitive.

Test plan

  • pnpm test — 232/232 pass.
  • svelte-check — 0 errors, 0 warnings across 723 files.
  • Smoke test: docker compose up -d --build, click Workspace shell on a running workspace, attach via Remote Control as "<workspace>", git merge feat-x, resolve, push, click Close shell, verify the boot window is idle again.
## Why Today each Nexus session is locked to its own per-session worktree at `/workspace/.nexus/worktrees/<name>` on a fresh branch. That's great for parallel feature work, but it leaves **no place inside Nexus to do the integration work** — merging finished session branches back into `main` and resolving the conflicts that fall out. The only way today is `docker exec` into the container by hand and run git there, outside of any Nexus session. This PR closes that gap with the smallest viable surface: a single **"Workspace shell"** toggle on each workspace card. ## What - Repurposes the entrypoint's existing idle `boot` tmux window — `tmux respawn-window`s it on demand so claude only runs there when an operator asks for it, no extra windows accumulate, and the window goes back to its initial-idle state when closed. - Launches `claude --remote-control "<workspace>"` rooted at `/workspace` (the real main-branch worktree) — the canonical place to do `git merge`, resolve conflicts, and push. - Toggle is idempotent: `openWorkspaceSession` leaves an in-flight claude untouched, and `closeWorkspaceSession` is a no-op when boot is already idle. The Close action is gated by a `confirm()`; conversation state is persisted to JSONL on disk so a stray click is recoverable. - Status is surfaced via a new `workspaceShellRunning` field on `workerHealth` (one extra `tmux display-message` per poll), which the UI uses to flip the button label/style. ## What this PR deliberately does NOT do - No new DB rows, schema migrations, or DTO surfaces — the workspace shell is not a "session" in the DB sense, by design. - No cross-session conflict detection, dry-run merges, Forgejo PR enrichment, or landing queue. The earlier brainstorm proposed all of those; this PR ships only the integration-shell primitive. ## Test plan - [x] `pnpm test` — 232/232 pass. - [x] `svelte-check` — 0 errors, 0 warnings across 723 files. - [ ] Smoke test: `docker compose up -d --build`, click **Workspace shell** on a running workspace, attach via Remote Control as `"<workspace>"`, `git merge feat-x`, resolve, push, click **Close shell**, verify the boot window is idle again.
feat(sessions): per-workspace shell toggle on the entrypoint boot pane
All checks were successful
ci / nexus (pull_request) Successful in 1m45s
ci / images (./nexus, agent-nexus) (pull_request) Successful in 2m54s
ci / images (./worker, nexus-worker) (pull_request) Successful in 49s
058330420a
Adds a "Workspace shell" toggle on each workspace card that respawns the
entrypoint's idle `boot` tmux window into `claude --remote-control "<workspace>"`
rooted at `/workspace` (the real main-branch worktree), useful for landing
session branches and resolving merge conflicts in the canonical place.

Reusing the boot window keeps the window count down and means claude only
runs there when invoked. The toggle is idempotent: openWorkspaceSession
leaves an in-flight claude untouched, and closeWorkspaceSession is a no-op
when boot is already idle. State is surfaced via workerHealth's new
`workspaceShellRunning` field (one extra `tmux display-message` per poll),
which the UI uses to flip the button label/style and gate a confirm()
before killing claude.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lz manually merged commit fa37d6702c into main 2026-05-16 19:10:14 +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
lz/agent-nexus!15
No description provided.