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.

fix: exclude trigger nodes from reopen/closed-session snapshots

Mina Sameh3fb071b0da8d
diff --git a/src/renderer/lib/reopenNode.test.ts b/src/renderer/lib/reopenNode.test.ts
index 6956329fc..48d62c698 100644
--- a/src/renderer/lib/reopenNode.test.ts
+++ b/src/renderer/lib/reopenNode.test.ts
@@ -43,8 +43,8 @@ describe('snapshotNode', () => {
})
})
- it('returns null for group/subagent/loop nodes', () => {
- for (const type of ['group', 'subagent', 'loop'] as const) {
+ it('returns null for group/subagent/loop/trigger nodes', () => {
+ for (const type of ['group', 'subagent', 'loop', 'trigger'] as const) {
const node = { type, position: { x: 0, y: 0 }, data: { title: 'x', color: '#fff', group: null } }
expect(snapshotNode(node, [])).toBeNull()
}
diff --git a/src/renderer/lib/reopenNode.ts b/src/renderer/lib/reopenNode.ts
index 79458ae5f..dd01604c0 100644
--- a/src/renderer/lib/reopenNode.ts
+++ b/src/renderer/lib/reopenNode.ts
@@ -44,7 +44,10 @@ type SnapshotSource = {
data: NodeData
}
-const UNRESTORABLE: ReadonlySet<string> = new Set(['group', 'subagent', 'loop'])
+// 'trigger' has no matching case in recreateNodeFromSnapshot's buildBase below (it always
+// recreates to null) — excluded here so a deleted trigger node never becomes a dead, clickable
+// closed-session/reopen-history entry.
+const UNRESTORABLE: ReadonlySet<string> = new Set(['group', 'subagent', 'loop', 'trigger'])
/** Captures a node right before deletion. `all` must be the FULL live tree (before any
* mutation), so the parent chain is still walkable. Returns null for kinds this feature