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.

style: move idle() off save()'s JSDoc, and the gate comment onto the gate tests

reviewf0aa368ab8f0
diff --git a/src/core/workspace-store.ts b/src/core/workspace-store.ts
index 8c6285623..1b486ecf3 100644
--- a/src/core/workspace-store.ts
+++ b/src/core/workspace-store.ts
@@ -1091,15 +1091,6 @@ export class WorkspaceStore {
* projects went blank after tab switching" wipe. */
private saveChain: Promise<unknown> = Promise.resolve()
- /**
- * `localOnly` makes the save durable on THIS machine only: every local file and the index (which
- * carries each SSH project's cache) are written, but no SSH project is read, reconciled or
- * mirrored — a changed, already-reconciled entry is marked `unmirrored` instead, so the next
- * ordinary save pushes it. It exists for the launch write-ahead barrier (`commitLaunchAttempt`):
- * that save must be on disk before a command is typed, and waiting on two SSH round trips per
- * save made every new agent node on an SSH project sit on QUEUED for seconds. It still runs on
- * the FIFO chain, so ordering against every other save is unchanged.
- */
/**
* Resolves once every write queued on `saveChain` so far (saves, content writes, reconciles) has
* finished, landed or failed; never rejects. The Server Edition's close awaits it BEFORE it stops
@@ -1110,6 +1101,15 @@ export class WorkspaceStore {
return this.saveChain.then(() => undefined)
}
+ /**
+ * `localOnly` makes the save durable on THIS machine only: every local file and the index (which
+ * carries each SSH project's cache) are written, but no SSH project is read, reconciled or
+ * mirrored — a changed, already-reconciled entry is marked `unmirrored` instead, so the next
+ * ordinary save pushes it. It exists for the launch write-ahead barrier (`commitLaunchAttempt`):
+ * that save must be on disk before a command is typed, and waiting on two SSH round trips per
+ * save made every new agent node on an SSH project sit on QUEUED for seconds. It still runs on
+ * the FIFO chain, so ordering against every other save is unchanged.
+ */
save(workspace: Workspace, opts: WorkspaceSaveOptions = {}): Promise<void> {
const run = this.saveChain.then(() => this.saveNow(workspace, opts.localOnly === true))
this.saveChain = run.catch(() => {})
diff --git a/src/renderer/canvas/nodesEpoch.test.tsx b/src/renderer/canvas/nodesEpoch.test.tsx
index 091d51e0f..15f8c7bb9 100644
--- a/src/renderer/canvas/nodesEpoch.test.tsx
+++ b/src/renderer/canvas/nodesEpoch.test.tsx
@@ -241,4 +241,3 @@ it('a peer op landing while a local edit is still queued keeps both', async () =
await settle()
expect(seen.at(-1)?.state).toEqual(['A-node', 'A-local', 'A-peer'])
})
-
diff --git a/src/shared/canvas-order.test.ts b/src/shared/canvas-order.test.ts
index 7aa243fa9..1b64b64ee 100644
--- a/src/shared/canvas-order.test.ts
+++ b/src/shared/canvas-order.test.ts
@@ -475,12 +475,6 @@ describe('createCanvasOrder', () => {
})
})
- // THE RE-CREATION GATE (port map §6.5). Rule 4 judges an upsert by what its sender had applied
- // when it cast (`seen`). Our OWN remove is applied locally at once, but it enters `seen` only when
- // its echo comes back — so a re-creation of the same id cast before that echo (a link deleted and
- // redrawn, a node deleted and ⌘Z'd, inside one round trip) carries a `seen` below the remove and
- // every peer drops it as a stale frame, while we keep showing it: a split. The caller holds such a
- // re-creation back while our remove is unacked; this is the question it asks.
// D4: `reset()` keeps our causal position for a same-core reconnect, but after a REAL restart the
// kept value sat above every seq the new core handed out until its counter caught up, so every
// cast read as "never stale" for that whole stretch. The first seq heard after a reset says which
@@ -520,6 +514,12 @@ describe('createCanvasOrder', () => {
})
})
+ // THE RE-CREATION GATE (port map §6.5). Rule 4 judges an upsert by what its sender had applied
+ // when it cast (`seen`). Our OWN remove is applied locally at once, but it enters `seen` only when
+ // its echo comes back — so a re-creation of the same id cast before that echo (a link deleted and
+ // redrawn, a node deleted and ⌘Z'd, inside one round trip) carries a `seen` below the remove and
+ // every peer drops it as a stale frame, while we keep showing it: a split. The caller holds such a
+ // re-creation back while our remove is unacked; this is the question it asks.
describe('a pending local remove (the re-creation gate)', () => {
it('reports a pending local remove until its echo returns', () => {
const o = createCanvasOrder('a')