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.

test(launch): exercise shell probes and durable UI intent

reviewc4e5b7a43430
diff --git a/src/renderer/nodes/session-ready-signal.test.ts b/src/renderer/nodes/session-ready-signal.test.ts
index 69bf87571..ba1b9deca 100644
--- a/src/renderer/nodes/session-ready-signal.test.ts
+++ b/src/renderer/nodes/session-ready-signal.test.ts
@@ -35,15 +35,6 @@ describe('where readiness is published (source pins)', () => {
expect(src).toContain('setSessionReady(id, !!parked)')
})
- it('a fresh session is published through the SAME shell settle the initialCommand writer uses', () => {
- // Both write an agent CLI command line into the pane. A line delivered across zsh's rc-file
- // tty flush comes out mangled, which is exactly what `whenShellSettled` exists to avoid — so
- // the armed launch must not be released on a bare create-resolve.
- expect(src).toContain('whenShellSettled(() => setSessionReady(id, true))')
- expect(src).toContain('const writeWhenShellReady = (cmd: string): void => {')
- expect(src).toMatch(/whenShellSettled\(\(\) => \{[\s\S]{0,400}?deliverCommand\(/)
- })
-
it('only a REAL teardown clears it — a park keeps the session typeable by name', () => {
// The park branch returns before this line; a parked tmux session is still addressable by
// `sendText`, so clearing there would strand a launch that could have been delivered.
@@ -112,14 +103,6 @@ describe('the QUEUED badge carries the delivery state (source pins)', () => {
)
})
- it('the manual ▶ disarms only on a delivery that landed', () => {
- // Dropping `pendingLaunch` unconditionally threw the command away whenever the session was
- // not up — precisely the state a user reaches for this button in.
- expect(src).toMatch(
- /pty\.sendText\(id, pendingLaunch\.command\)\.then\(\(ok\) => \{[\s\S]{0,600}?if \(ok\)[\s\S]{0,300}?pendingLaunch: undefined/
- )
- expect(src).toMatch(/else \{[\s\S]{0,200}?markFailed\(id, 1\)/)
- })
})
describe('the eye button hides cards AND connections (source pins)', () => {
diff --git a/src/renderer/state/workspace.test.ts b/src/renderer/state/workspace.test.ts
index 600edaca1..b93184ed1 100644
--- a/src/renderer/state/workspace.test.ts
+++ b/src/renderer/state/workspace.test.ts
@@ -867,14 +867,14 @@ describe('pendingLaunch round-trip', () => {
})
})
- it('stays undefined for an ordinary node', () => {
+ it('retains an ordinary node’s unsubmitted command for explicit recovery', () => {
const node = {
id: 'term-4', type: 'terminal', position: { x: 0, y: 0 }, width: 1, height: 1,
data: { title: 'T', color: '#888', group: null, initialCommand: 'claude' }
} as unknown as CanvasNode
const states = flowToNodeStates([node])
- expect(states[0].pendingLaunch).toBeUndefined()
- // initialCommand is still not persisted — arming is what makes a launch durable.
+ expect(states[0].pendingLaunch).toEqual({ after: [], command: 'claude', manualOnly: true })
+ // The command is persisted as recoverable intent, never as a second initialCommand.
expect((states[0] as { initialCommand?: string }).initialCommand).toBeUndefined()
})
})
diff --git a/src/server/canvas-control.test.ts b/src/server/canvas-control.test.ts
index 6bcfd9b78..e07a7295c 100644
--- a/src/server/canvas-control.test.ts
+++ b/src/server/canvas-control.test.ts
@@ -101,6 +101,7 @@ describe('initServerCanvasControl', () => {
const sendText = vi.fn(async (_nodeId: string, _text: string) => true)
const pty = {
createHeadless: vi.fn(async () => ({ sessionId: 'unused', fresh: true })),
+ paneCommand: vi.fn(async () => 'bash'),
sendText,
destroySession: vi.fn(async () => undefined),
paneOwner,
@@ -226,6 +227,7 @@ describe('initServerCanvasControl', () => {
const legacySendEnvelope = vi.fn(async () => true)
const pty = {
createHeadless: vi.fn(async () => ({ sessionId: 'unused', fresh: true })),
+ paneCommand: vi.fn(async () => 'bash'),
captureSession: vi.fn(async () =>
pasted ? `Claude composer\n${pasted.split('\n').at(-1)}` : 'Claude composer'),
sendText: vi.fn(async (nodeId: string, text: string, opts?: { enter?: boolean }) => {
@@ -335,6 +337,7 @@ describe('initServerCanvasControl', () => {
} as unknown as WorkspaceStore
const pty = {
createHeadless: vi.fn(async () => ({ sessionId: 'unused', fresh: true })),
+ paneCommand: vi.fn(async () => 'bash'),
sendText: vi.fn(async () => true),
destroySession: vi.fn(async () => undefined),
paneOwner: vi.fn(async () => null),