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.

Merge origin/main into feat/canvas-control-orchestration-trio

enes8f940d9bc0ee
diff --cc src/main/canvas-control-core.ts
index da7fd8726,7a169d5c3..206066ae2
--- a/src/main/canvas-control-core.ts
+++ b/src/main/canvas-control-core.ts
@@@ -322,14 -303,13 +322,16 @@@ export function buildCanvasControlInstr
' included); or an id `open-project` returned to YOU in this session, which never switches the',
' user\'s view. A session opened into a non-active project starts when the user next views that',
' project — do not poll for it. `--group`/`--after` cannot be combined with `--project`.',
- ' `--prompt` arrives on ONE LINE: every whitespace run in it, newlines included, is collapsed',
- ' to a single space (the prompt rides the launch command line typed into the pane). For a',
- ' structured or multi-line brief use `--prompt-file <abs path>` instead: write the brief to a',
- ' file, pass the absolute path, and the session starts with the file\'s exact contents —',
- ' newlines, numbered lists and headings preserved. The file is read when the session LAUNCHES',
- ' (later than the call for an `--after`-armed node), so leave it in place until the station has',
- ' started. Never begin a prompt with `/`: the agent reads the whole text as that slash',
- ' command\'s arguments and your task is never seen — use `--model` to pick a model.',
+ ' `--prompt` arrives on ONE LINE: every run of whitespace in it, newlines included, is',
- ' collapsed to a single space before the session starts. Write the task as continuous prose',
- ' and use sentences where you would have used bullets — a numbered list arrives as one',
- ' paragraph. Never begin a prompt with `/`: once flattened, the agent reads the whole prompt',
- ' as arguments to that slash command, your task is never seen, and the node then sits idle',
- ' looking healthy. To pick a model use `--model`, not a leading `/model`. To send a long or',
- ' structured brief, open the node and follow up with `send --node <id> --text "..."`.',
++ ' collapsed to a single space before the session starts (the prompt rides the launch command',
++ ' line typed into the pane). For a structured or multi-line brief use `--prompt-file <abs',
++ ' path>` instead: write the brief to a file, pass the absolute path, and the session starts',
++ ' with the file\'s exact contents — newlines, numbered lists and headings preserved. The file',
++ ' is read when the session LAUNCHES (later than the call for an `--after`-armed node), so',
++ ' leave it in place until the station has started. Never begin a prompt with `/`: once',
++ ' flattened, the agent reads the whole prompt as arguments to that slash command, your task',
++ ' is never seen, and the node then sits idle looking healthy. To pick a model use `--model`,',
++ ' not a leading `/model`.',
' `--model <id>` picks the model the session launches with, instead of inheriting the',
' default. Use it to keep a cheap station cheap: a node whose whole job is editing a README',
' does not need the model you give the node rewriting a test suite. Honoured by claude, codex',
@@@ -708,19 -680,18 +710,22 @@@ Verbs
non-active project starts when the user next views that project — do not poll for it; the reply
says so. \`--group\`/\`--after\` cannot be combined with \`--project\`.
\`--prompt\` arrives on ONE LINE. Every run of whitespace in it — newlines included — is
- collapsed to a single space, because the prompt is passed as an argument on the agent CLI's
- launch command line and that line is typed into the pane. Two consequences:
+ collapsed to a single space before the session starts, because the prompt is passed as an
- argument on the agent CLI's launch command line and that line is typed into the pane. So write
- the task as continuous prose: a numbered list or a markdown heading arrives as one paragraph,
- and indentation is lost. Two consequences worth planning around:
++ argument on the agent CLI's launch command line and that line is typed into the pane. Two
++ consequences worth planning around:
+ - **A structured brief goes through \`--prompt-file <abs path>\`.** Write the brief (numbered
+ acceptance criteria, file lists, guard clauses — anything multi-line) to a file, pass the
+ absolute path, and the session starts with the file's exact contents: the launch line stays
+ one line and the pane's shell reads the file at execution. The file is read when the session
+ LAUNCHES — for an \`--after\`-armed node that is later than your call — so leave it in place
+ until the station has started. On an SSH project the path is on the host (where you run).
+ Pass either \`--prompt\` or \`--prompt-file\`, not both.
- - **Never start a prompt with \`/\`.** The agent reads the whole prompt as arguments to that
- slash command, your task is never seen, and the node then sits at an idle prompt looking
- healthy — including to \`--after\`, which will arm everything behind it. Use \`--model\` for
- the model; there is no supported way to run a slash command at launch.
+ - **Never start a prompt with \`/\`.** Flattened, \`/model sonnet\` followed by your task reads
+ to the agent as one slash command whose argument is the entire rest of the prompt. The
+ command fails, your task is never seen, and the node then sits at an idle prompt looking
+ perfectly healthy — including to \`--after\`, which will arm everything behind it. Use
+ \`--model\` for the model; there is no supported way to run a slash command at launch.
- - **For a long or structured brief, split it.** Open the node with a short \`--prompt\` (or
- none), then deliver the body with \`send --node <id> --text "..."\`, which preserves the text
- as written.
++
\`--model <id>\` decides which model the session LAUNCHES with, instead of inheriting the
project default. This is the lever for cost: a station whose job is editing a README does not
need the model you give the station rewriting a 1000-line test suite, and without this flag
diff --cc src/shared/agents/launch.ts
index d80a7d32e,42cbd4de6..4ab638b82
--- a/src/shared/agents/launch.ts
+++ b/src/shared/agents/launch.ts
@@@ -183,22 -154,17 +183,24 @@@ export function assembleLaunchCommand
const { fragment: argsFragment, missing: m2 } = expandedArgs(inputs.customAgent?.args ?? '', env)
const baseCmd = argsFragment ? `${program} ${argsFragment}` : program
- // The prompt becomes a POSITIONAL ARGUMENT on a command line that is then typed into the pane
- // (`writeWhenShellReady` -> `deliverCommand`, which echo-verifies the line before submitting it).
- // A newline inside it would submit the half-typed line and fail that verification, so every run
- // of whitespace is collapsed to a single space. Load-bearing for this delivery path, not tidying:
- // preserving structure means delivering the prompt as a MESSAGE after launch (sendText, which
- // frames multi-line text through tmux `paste-buffer -p`) rather than as argv. Callers that let a
- // user or an agent supply the prompt must say the text arrives on one line -- see
- // `buildCanvasSkillBody` / `buildCanvasControlInstructions`.
- const promptArg = inputs.initialPrompt
- ? shellSingleQuote(inputs.initialPrompt.replace(/\s+/g, ' ').trim())
- : null
+ // The prompt becomes an ARGUMENT on a command line that is then typed into the pane
+ // (`writeWhenShellReady` → `deliverCommand`, which echo-verifies the line before submitting).
+ // A raw newline inside it would submit the half-typed line and fail that verification, so:
+ // - `initialPrompt` (a literal) has every whitespace run collapsed to a single space —
- // load-bearing for the delivery path, not tidying (issue #520 / PR #516's finding).
- // - `promptFile` keeps structure WITHOUT putting it on the typed line: the argument is a
- // `"$(cat '<path>')"` command substitution, so the pane's shell reads the file at execution
- // and hands the CLI its exact contents as ONE argv element. The double quotes make the
- // substitution a single word and keep its RESULT data — file content is never re-parsed as
- // shell syntax. On an SSH project the path (and the `cat`) are on the host, which is exactly
- // where the node runs. Only the PATH is interpolated, and it is single-quoted.
++ // load-bearing for the delivery path, not tidying (PR #516's finding). Callers that let a
++ // user or an agent supply the prompt must say the text arrives on one line — see
++ // `buildCanvasSkillBody` / `buildCanvasControlInstructions`.
++ // - `promptFile` (issue #520) keeps structure WITHOUT putting it on the typed line: the
++ // argument is a `"$(cat '<path>')"` command substitution, so the pane's shell reads the file
++ // at execution and hands the CLI its exact contents as ONE argv element. The double quotes
++ // make the substitution a single word and keep its RESULT data — file content is never
++ // re-parsed as shell syntax. On an SSH project the path (and the `cat`) are on the host,
++ // which is exactly where the node runs. Only the PATH is interpolated, single-quoted.
+ const promptArg = inputs.promptFile
+ ? `"$(cat ${shellSingleQuote(inputs.promptFile.trim())})"`
+ : inputs.initialPrompt
+ ? shellSingleQuote(inputs.initialPrompt.replace(/\s+/g, ' ').trim())
+ : null
const sep = eff.argvPromptSeparator
const promptFlag =
eff.promptInjectionMode === 'flag-prompt'