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; order createAgentNode's two new trailing params

enes0de1e6bde4fa
diff --cc src/renderer/canvas/Canvas.tsx
index 17e662ba6,3ae31f868..73f73d619
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@@ -4997,8 -5423,9 +5431,11 @@@ export function Canvas()
// The mode belongs to the node being OPENED, so it is gated on the TARGET agent — a
// handoff into grok must not inherit claude's version gate.
activePermissionMode(targetAgentId),
+ // The transfer target lands in the active project's canvas, so that project's launch
+ // command applies to it — the same project `projectSsh` was just resolved from.
- activeProjectId
++ activeProjectId,
+ // A model picked from the Transfer submenu (only offered for switch-capable targets).
+ model
)
node.selected = true
const placed = placeSpawned(node, at ?? besideNode(source))
diff --cc src/renderer/state/workspace.test.ts
index 088341c4d,d05b25dbb..f3aabed7e
--- a/src/renderer/state/workspace.test.ts
+++ b/src/renderer/state/workspace.test.ts
@@@ -566,27 -571,6 +571,27 @@@ describe('accountId on Claude node fact
})
})
+describe('model on agent node factory', () => {
+ it('stamps agentModel and threads --model into the launch command for a switch-capable agent', () => {
- const node = createAgentNode('claude', 0, undefined, undefined, undefined, undefined, undefined, undefined, 'claude-sonnet-5')
++ const node = createAgentNode('claude', 0, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 'claude-sonnet-5')
+ expect(node.data.agentModel).toBe('claude-sonnet-5')
+ expect(node.data.initialCommand).toContain('--model')
+ expect(node.data.initialCommand).toContain('claude-sonnet-5')
+ })
+ it('omits agentModel and the --model flag when no model is given', () => {
+ const node = createAgentNode('claude', 0)
+ expect(node.data.agentModel).toBeUndefined()
+ expect(node.data.initialCommand).not.toContain('--model')
+ })
+ it('drops the model (no --model) for a non-switch-capable agent', () => {
+ // gemini is not in MODEL_SWITCH_CAPABLE — withAgentModel no-ops, and agentModel is still stamped
+ // (it is harmless to persist; the point is the launch line carries no --model).
- const node = createAgentNode('gemini', 0, undefined, undefined, undefined, undefined, undefined, undefined, 'gemini-2.5')
++ const node = createAgentNode('gemini', 0, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 'gemini-2.5')
+ expect(node.data.agentModel).toBe('gemini-2.5')
+ expect(node.data.initialCommand).not.toContain('--model')
+ })
+})
+
describe('accountId serialization', () => {
it('round-trips data.accountId on a terminal node', () => {
const node = {
diff --cc src/renderer/state/workspace.ts
index 2731ba787,2a8409508..421cc9eb3
--- a/src/renderer/state/workspace.ts
+++ b/src/renderer/state/workspace.ts
@@@ -386,18 -545,15 +545,21 @@@ export function createAgentNode
ssh?: Project['ssh'],
accountId?: string,
permissionMode?: AgentPermissionMode,
- projectId?: string
++ projectId?: string,
+ /** Per-node model override for a MODEL_SWITCH_CAPABLE agent (claude/codex/copilot, base-resolved).
+ * Applied through the effective base harness via `withAgentModel` (a no-op for a non-capable
+ * agent, so passing a model for one is harmless — it's simply not appended). Persisted as
- * `data.agentModel` so cold-restore and later restarts keep the model. */
++ * `data.agentModel` so cold-restore and later restarts keep the model. Trails `projectId`: every
++ * existing caller passes that ninth argument, so the model is the one that had to move. */
+ model?: string
): CanvasNode {
const { label, color } = resolveAgent(agentId)
- // A per-builtin launch-command override (Settings -> Agents -> Launch commands) replaces the bare
- // CLI in the assembled command. Threaded into the shared assembler below as `launchCmdOverride`
- // so fresh launch, cold-restore resume and in-place restart all pick it up identically. Custom
- // agents already own their `launchCmd`, so the helper returns undefined for them.
- const launchCmdOverride = agentLaunchOverride(agentId)
+ // The launch-command override (this project's `.nodeterm/settings.json` first, then Settings →
+ // Agents → Launch commands — see `agentLaunchOverride`) replaces the bare CLI in the assembled
+ // command. Threaded into the shared assembler below as `launchCmdOverride` so fresh launch,
+ // cold-restore resume and in-place restart all pick it up identically. Custom agents already own
+ // their `launchCmd`, so the global layer returns undefined for them.
+ const launchCmdOverride = agentLaunchOverride(agentId, projectId)
// The session id is DECIDED here rather than learned from a hook later, so this node always has
// something to resume with — see SESSION_ID_CAPABLE for the failure this closes. `uuid()` (not
// crypto.randomUUID) because the Server Edition serves plain HTTP on a LAN, where randomUUID is