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(push): alerts and Live Activities carry the node's CURRENT name

enesb8309694e3d9
diff --git a/src/core/agent-status-mirror.ts b/src/core/agent-status-mirror.ts
index 9d0c9cfde..bca26f1fa 100644
--- a/src/core/agent-status-mirror.ts
+++ b/src/core/agent-status-mirror.ts
@@ -1375,6 +1375,11 @@ export function setNodeSessionName(nodeId: string, name: string): boolean {
return true
}
+/** A node's published session name (see MirrorEntry.name), or undefined. */
+export function nodeSessionName(nodeId: string): string | undefined {
+ return state.get(nodeId)?.name
+}
+
/** A node's current main state, or undefined when unknown. Read-only peek for the shells. */
export function nodeState(nodeId: string): AgentState | undefined {
return state.get(nodeId)?.state
diff --git a/src/core/session-name-sweep.ts b/src/core/session-name-sweep.ts
index 3915ca3dd..53b59f038 100644
--- a/src/core/session-name-sweep.ts
+++ b/src/core/session-name-sweep.ts
@@ -85,3 +85,26 @@ export function startSessionNameSweep(
clearTimeout(first)
}
}
+
+/**
+ * The name to SHOW for a node, host-side: the agent's live session name when the node still
+ * auto-tracks it, else the persisted node title. The same rule the canvas applies (`titleAuto`)
+ * and the phone applies to its lists — used here so push alerts and Live Activities carry the
+ * CURRENT name instead of the title the workspace file happens to hold (which only refreshes
+ * while that node is mounted in an open project).
+ */
+export function displayNodeTitle(
+ nodeId: string,
+ deps: {
+ sessionName: (nodeId: string) => string | undefined
+ node: (nodeId: string) => { title?: string; titleAuto?: boolean } | undefined
+ }
+): string | undefined {
+ const node = deps.node(nodeId)
+ if (node?.titleAuto !== false) {
+ const live = deps.sessionName(nodeId)?.trim()
+ if (live) return live
+ }
+ const title = node?.title?.trim()
+ return title || undefined
+}
diff --git a/src/main/index.ts b/src/main/index.ts
index 6497c1b24..de561431d 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1,5 +1,5 @@
import { join, resolve, posix } from 'path'
-import { startSessionNameSweep } from '../core/session-name-sweep'
+import { startSessionNameSweep, displayNodeTitle } from '../core/session-name-sweep'
import { readSessionName as readSessionNameForSweep } from '../core/transcript-reader'
import { canRename, type AgentId } from '@shared/agents/config'
import { readFile } from 'fs/promises'
@@ -56,7 +56,8 @@ import {
type MirrorSettings,
setNodeSessionName,
sessionNameSweepEntries,
- nodeState
+ nodeState,
+ nodeSessionName
} from '../core/agent-status-mirror'
import { createPushNotify, createLiveUpdatePush } from '../core/push-notify'
import { createGrantsAccessor } from '../core/push-grants'
@@ -785,6 +786,17 @@ app.whenReady().then(async () => {
// Mirror live agent status to <userData>/agent-status.json for the external mobile host agent.
initAgentStatusMirror()
+ /** The one display-title rule for everything the HOST sends out (push alerts, Live Activity
+ * updates, the notch capsule): the live session name unless the node was hand-renamed. */
+ const displayTitleFor = (nodeId: string): string | undefined =>
+ displayNodeTitle(nodeId, {
+ sessionName: nodeSessionName,
+ node: (id) => {
+ const n = workspaceStore.getNode(id)
+ return n ? { title: n.title, titleAuto: n.titleAuto } : undefined
+ }
+ })
+
// Keep every agent node's session name fresh in the mirror — including nodes no canvas has
// mounted (the phone lists them all; see core/session-name-sweep.ts).
startSessionNameSweep({
@@ -810,7 +822,7 @@ app.whenReady().then(async () => {
return { enabled: s.notchHud, notchWidth: s.notchWidth, hoverExpand: s.notchHoverExpand }
}
const startNotchHud = (): void =>
- initNotchHud({ getNodeTitle: (nodeId) => workspaceStore.getNodeTitle(nodeId) }, notchTunables())
+ initNotchHud({ getNodeTitle: displayTitleFor }, notchTunables())
if (win.isVisible()) startNotchHud()
else win.once('show', startNotchHud)
settingsStore.onChange(() => applyNotchHudSettings(notchTunables()))
@@ -931,7 +943,7 @@ app.whenReady().then(async () => {
isPackaged: () => app.isPackaged,
// The node's canvas/sidebar display title, so the phone can title the alert
// "<Needs you|Completed> — <nodeTitle>" (see workspace-store.getNodeTitle for the freshness note).
- getNodeTitle: (nodeId) => workspaceStore.getNodeTitle(nodeId),
+ getNodeTitle: displayTitleFor,
// Presence-aware deferral wiring (alerts only).
isUserPresent,
subscribePresence: (cb) => {
@@ -964,7 +976,7 @@ app.whenReady().then(async () => {
mobilePushEnabled: () => settingsStore.get().mobilePushEnabled !== false,
mobileLiveActivities: () => settingsStore.get().mobileLiveActivities !== false,
isPackaged: () => app.isPackaged,
- getNodeTitle: (nodeId) => workspaceStore.getNodeTitle(nodeId)
+ getNodeTitle: displayTitleFor
})
// And push each connected SSH project's slice of it onto its host
// (`~/.nodeterm/agent-status-<projectId>.json`): hook events tunnel from the host to THIS
diff --git a/src/server/index.ts b/src/server/index.ts
index 0b2d9c4da..4b515c861 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -1,6 +1,6 @@
import fs from 'fs'
import { readSessionName } from '../core/transcript-reader'
-import { startSessionNameSweep } from '../core/session-name-sweep'
+import { startSessionNameSweep, displayNodeTitle } from '../core/session-name-sweep'
import { canRename, type AgentId } from '@shared/agents/config'
import path from 'path'
import http from 'http'
@@ -41,7 +41,8 @@ import {
type MirrorSettings,
type MirrorServer,
setNodeSessionName,
- sessionNameSweepEntries
+ sessionNameSweepEntries,
+ nodeSessionName
} from '../core/agent-status-mirror'
import { createPushNotify, createLiveUpdatePush } from '../core/push-notify'
import { createGrantsAccessor } from '../core/push-grants'
@@ -340,7 +341,15 @@ export async function startServer(
markGrantDead: (grant: string) => pushGrants.markDead(grant),
hostLabel: () => os.hostname(),
isPackaged: () => true,
- getNodeTitle: (nodeId: string) => workspaceStore.getNodeTitle(nodeId)
+ // Same host-side display rule as the desktop: the live session name unless hand-renamed.
+ getNodeTitle: (nodeId: string) =>
+ displayNodeTitle(nodeId, {
+ sessionName: nodeSessionName,
+ node: (id) => {
+ const n = workspaceStore.getNode(id)
+ return n ? { title: n.title, titleAuto: n.titleAuto } : undefined
+ }
+ })
}
createPushNotify({
subscribe: onInboxActionable,