Skip to content

feat(sessions): "Operations" menu with in-place Reload (v0.223.0)#371

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/session-operations-menu
Jul 16, 2026
Merged

feat(sessions): "Operations" menu with in-place Reload (v0.223.0)#371
vikasprogrammer merged 1 commit into
mainfrom
feat/session-operations-menu

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What

Adds an Operations dropdown pinned top-right of every session's live terminal, next to Files. It gathers the session-lifecycle actions into one menu:

  • Reload (new) — restart the agent process in place (kill the pane, then claude --resume the same session id) so a newly-connected MCP server is picked up. MCP servers only spawn at claude launch, so a running session otherwise can't see one added mid-run.
  • Transfer — hand the run-as to another teammate (the "share" action; reuses the existing transfer flow).
  • Fork — branch a new session from this conversation (moved here from the terminal tab-strip hover controls; still available on the session cards/rows).
  • Stop / Delete.

Why Reload is safe

reloadSession is a lighter sibling of stopSession: it kills the pane and leaves the session resurrectable (no stop-marker), but writes no stopped episode and cancels only the now-unanswerable pending questions/approvals. So the run stays whole — the conversation is preserved via claude --resume and the real end-of-run episode still fires later. The session is parked stopped for the sub-second window before re-attach so the crash-detector (gone tmux on a running row) doesn't mislabel the restart. Gated to resumable claude-code sessions (headless runs have no launch env to resume).

Changes

  • src/terminal.tsTerminalManager.reloadSession; session.reloaded added to EPISODE_NOISE.
  • src/server.tsPOST /api/sessions/:id/reload (same per-member gate as stop/resume).
  • web/src/App.tsxOperationsMenu component threaded through TerminalFrameImageDropZone; terminal remounts (nonce bump) after reload to re-attach and resurrect. Fork removed from the tab-strip hover controls.
  • web/src/lib/api.tsapi.reloadSession.

Verification

  • npm run typecheck, npm run build, cd web && npm run build — all clean.
  • npm run test:governance — 68/68 passed.
  • Isolated in-process harness against a real TerminalManager: unknown session → unknown session; a row with no persisted env → cannot be reloaded, and the guard returns before touching the pane (status unchanged).

🤖 Generated with Claude Code

…d (v0.223.0)

Add a dropdown pinned top-right of the live terminal, next to Files, that
gathers the session-lifecycle actions in one place: Reload, Fork, Stop, Delete,
and Transfer (hand the run-as to a teammate — the "share" action).

Reload is new: it restarts the agent process IN PLACE (kill the pane, then
`claude --resume` the same session id) so a newly-connected MCP server is picked
up — MCP servers only spawn at claude launch, so a running session otherwise
can't see one added mid-run. Unlike Stop, reloadSession writes no "stopped"
episode and drops no resume-block, so the run stays whole and the real
end-of-run episode still fires; the pane dies <1s while the console remounts the
terminal to re-attach and attach.sh resurrects.

- src/terminal.ts: TerminalManager.reloadSession (guarded to resumable
  claude-code sessions); session.reloaded added to EPISODE_NOISE.
- src/server.ts: POST /api/sessions/:id/reload (same per-member gate as stop).
- web: OperationsMenu component + api.reloadSession; Fork moved here from the
  terminal tab-strip hover controls (still on the session cards/rows).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019zMSbnPEbqSVPGLasTKENp
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