Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

docs(gemini): correct the comments the restart-target change made stale

enes742912ebd75e
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index edd96d26c..0a80ae5dd 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -4672,7 +4672,7 @@ export function Canvas() {
const n = nodesRef.current.find((x) => x.id === ids[0])
const st = useAgentStatus.getState().byId[ids[0]]
const gate = restartEligibility(restartAgentIdOf(n), st?.state, st?.sessionId)
- // 'not-resumable' is permanent (a plain shell, gemini, a custom CLI with no exit
+ // 'not-resumable' is permanent (a plain shell, opencode, a custom CLI with no exit
// command) — no row at all. The other two are temporary, so the row stays and says
// what to wait for instead of disappearing and teaching nothing.
if (!gate.ok && gate.reason === 'not-resumable') return []
diff --git a/src/renderer/terminal/agent-restart.ts b/src/renderer/terminal/agent-restart.ts
index 8131cf5eb..f26d0e790 100644
--- a/src/renderer/terminal/agent-restart.ts
+++ b/src/renderer/terminal/agent-restart.ts
@@ -14,20 +14,19 @@ import {
} from './command-delivery'
/** In-band exit command per agent CLI. Only agents listed here can be restarted in place —
- * an unknown CLI has no safe way to be asked to quit.
+ * an unknown CLI has no safe way to be asked to quit. One entry turns on both surfaces at once:
+ * the single-node "Restart agent (resume)" row in the node context menu, and the bulk "restart
+ * idle agents" action (pane menu + command palette). There is no header button for either —
+ * `HIDEABLE_HEADER_BUTTONS` is refresh / mic / ai-name / comments. The matching relaunch line
+ * always comes from `resumeCommand`.
*
- * grok: `/quit` (its `/exit` is an alias — the documented primary is the one we type), and its
- * relaunch line comes from `resumeCommand` → `grok --resume <id>`, so one entry here turns on both
- * surfaces at once: the single-node "Restart agent (resume)" row in the node context menu, and the
- * bulk "restart idle agents" action (pane menu + command palette). There is no header button for
- * either — `HIDEABLE_HEADER_BUTTONS` is refresh / mic / ai-name / comments.
+ * Each value is the CLI's own DOCUMENTED PRIMARY, and is sent BARE:
+ * - grok: `/quit` (its `/exit` is an alias).
+ * - gemini: `/quit` (alias `/exit`), measured in its bundled `docs/reference/commands.md:325`.
*
- * gemini: `/quit` (alias `/exit`), measured in its own bundled
- * `docs/reference/commands.md:325`, and relaunched as `gemini --resume <id>`. The command must be
- * sent BARE: the same command also takes a `--delete` flag that exits AND *permanently deletes*
- * the session's history and temporary files. A restart that ever typed `/quit --delete` would
- * destroy the very conversation the `--resume` behind it is meant to return to, so nothing may
- * append arguments to a value in this table. */
+ * Bare is a safety rule, not a style: gemini's `/quit` also takes a `--delete` flag that exits AND
+ * *permanently deletes* the session's history and temporary files — the very conversation the
+ * `--resume` behind it is meant to return to. Nothing may append arguments to a value here. */
const EXIT_SEQUENCES: Record<string, string> = {
claude: '/exit',
codex: '/quit',
@@ -54,9 +53,10 @@ export type IneligibleReason = 'working' | 'no-session' | 'not-resumable'
/** States in which the pane must be left alone. `blocked` is here for a sharper reason than
* politeness: it means a permission / question dialog owns the prompt (see normalize.ts —
* Claude's PermissionRequest, codex's permission.asked / question.asked, gemini's
- * Notification/ToolPermission), so writing `/exit`
- * would be typed AS THE ANSWER to that dialog instead of quitting the CLI. Both states report
- * the reason `'working'`: to the user they are the same "busy, try again in a moment". */
+ * Notification/ToolPermission), so writing the exit line would be typed AS THE ANSWER to that
+ * dialog instead of quitting the CLI — whichever line it is (`/exit` for claude, `/quit` for the
+ * rest). Both states report the reason `'working'`: to the user they are the same "busy, try
+ * again in a moment". */
const BUSY_STATES = new Set(['working', 'blocked'])
/** Single gate shared by the node menu, the bulk filter and the choreography itself.
@@ -187,10 +187,12 @@ export async function performRestartResume(d: {
// draft lost and a real turn started (tokens, possibly edits) — and the CLI, still running,
// would then be reported as an exit timeout.
//
- // ASSUMPTION, unverified on a real build: Ctrl-U is "clear line" inside the Claude and codex
- // TUIs (it is in every readline/ZLE prompt, and it is what command-delivery.ts already relies on
- // for its rewrites). If a TUI binds it to something else this becomes one stray keystroke before
- // the exit command — no worse than today's blind write. Belongs in the manual test matrix.
+ // ASSUMPTION, unverified on a real build: Ctrl-U is "clear line" inside every TUI in
+ // EXIT_SEQUENCES (claude, codex, grok, gemini) — it is in every readline/ZLE prompt, and it is
+ // what command-delivery.ts already relies on for its rewrites. Each agent added to that table
+ // inherits this assumption; only a device check retires it, per agent. If a TUI binds Ctrl-U to
+ // something else this becomes one stray keystroke before the exit command — no worse than
+ // today's blind write. Belongs in the manual test matrix.
d.io.write(KILL_LINE)
d.io.write(exit + '\r')
const deadline = Date.now() + timeoutMs