Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: stop listing macOS's native CursorUIViewService as a running agent

[._.]/ Adam Eivy82b4a7ea2391
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 54a4a21216..4d949e84df 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -13,6 +13,7 @@
## Internal
+- **The Agents page no longer lists macOS's native text-caret helper as a "Cursor" agent** — the running-agents scan matches process names by substring, so `cursor` also matched `CursorUIViewService` — a macOS TextInputUI framework helper (the blinking text caret), not the Cursor AI editor — and it showed up as a running agent. The scan now excludes system framework / XPC-service helpers (paths under `/System/Library/`, `*.framework/`, `*.xpc/`) alongside the existing `.app` bundle exclusion, so only real agent CLIs appear.
- **[issue-2958] Polyfill jsdom `scrollIntoView` in the client test setup** — jsdom doesn't implement `Element.prototype.scrollIntoView`, so a `requestAnimationFrame` callback that calls it (e.g. `Tribe.jsx`, `CmdKSearch.jsx`, and other components) could fire after its test unmounted and turn into an unhandled error that failed the *entire* client suite despite every assertion passing — an intermittent CI flake that forced no-op re-runs on unrelated PRs. `client/src/test/setup.js` now installs a guarded no-op `scrollIntoView` stub alongside the storage polyfill, killing the whole class of flake in one place. Production is unaffected (the stub only fills the jsdom gap).
- **[issue-2951] Image-to-3D target registry (foundation)** — added a pluggable `server/services/imageTo3d/targets.js` registry (mirroring `imageGen/modes.js`) that models image→3D models as selectable targets with hardware-gated availability resolution, TRELLIS.2 registered as the first target, and a read-only `GET /api/image-to-3d/targets` endpoint. Backend groundwork for the forthcoming 3D page under Create (#2952 install/runner, #2953 page/viewer, #2954 CUDA lane); no user-visible surface yet.
- **[issue-2952] TRELLIS.2 local runner scaffolding** — added `server/services/imageTo3d/trellis2.js`: on-disk install detection, pure install/generate command builders, a format-agnostic `generate.py` progress parser, and a guarded generate runner (throws unless installed; never auto-runs). `GET /api/image-to-3d/targets` now also reports each target's `installed` state. The real ~15 GB install + live GPU render are user-triggered and validated hands-on (remainder of #2952); no user-visible surface yet.
diff --git a/server/services/agents.js b/server/services/agents.js
index 3945cf30bb..daf196f713 100644
--- a/server/services/agents.js
+++ b/server/services/agents.js
@@ -17,6 +17,30 @@ const AGENT_PATTERNS = [
// Track spawned agents with their full commands (by PID)
const spawnedAgentCommands = new Map();
+/**
+ * Decide whether a matched process line is a real AI-agent CLI or an OS/UI
+ * helper that only happens to share a substring with an agent name.
+ *
+ * The pattern grep is a coarse substring match, so `cursor` also matches macOS
+ * native helpers like the TextInputUI framework's `CursorUIViewService.xpc`
+ * (a text-caret UI service, NOT the Cursor AI editor). Those live under system
+ * framework / XPC-service / app-bundle paths that no agent CLI is ever invoked
+ * from, so we exclude the whole class rather than blacklisting one binary.
+ */
+export function isAgentProcessCommand(command) {
+ if (!command) return false;
+ // Our own scanner and the grep it pipes through.
+ if (command.includes('grep') || command.includes('ps -eo')) return false;
+ // macOS app bundles (e.g. Cursor.app) and their embedded helpers, plus the
+ // system framework / XPC-service helpers those bundles spawn — none of these
+ // is an agent CLI, they just share a name substring (e.g. CursorUIViewService).
+ if (command.includes('.app/Contents/')) return false;
+ if (command.includes('/System/Library/')) return false;
+ if (command.includes('.framework/')) return false;
+ if (command.includes('.xpc/')) return false;
+ return true;
+}
+
/**
* Register a spawned agent's full command (call when spawning)
*/
@@ -139,9 +163,10 @@ async function findUnixProcesses(pattern) {
const etime = parts[4];
const command = parts.slice(5).join(' ');
- // Skip grep, our own process, and macOS app bundles (e.g. Cursor.app)
- if (command.includes('grep') || command.includes('ps -eo')) continue;
- if (command.includes('.app/Contents/')) continue;
+ // Skip grep, our own scanner, macOS app bundles, and the system
+ // framework / XPC helpers that only match a name substring (e.g. the
+ // native CursorUIViewService, not the Cursor AI editor).
+ if (!isAgentProcessCommand(command)) continue;
// Parse elapsed time to get start time
const runtime = parseElapsedTime(etime);
diff --git a/server/services/agents.test.js b/server/services/agents.test.js
index 2738384808..780ab4a469 100644
--- a/server/services/agents.test.js
+++ b/server/services/agents.test.js
@@ -34,7 +34,8 @@ import {
unregisterSpawnedAgent,
getRunningAgents,
killProcess,
- getProcessInfo
+ getProcessInfo,
+ isAgentProcessCommand
} from './agents.js';
// Helper to simulate exec callback.
@@ -207,6 +208,24 @@ describe('agents.js', () => {
expect(claudeAgents[0].startTime).toBeGreaterThan(claudeAgents[1].startTime);
});
+ it('skips macOS native CursorUIViewService (framework/XPC helper), not the Cursor editor', async () => {
+ // The `cursor` grep also matches the native TextInputUI helper — a text-caret
+ // UI service, not the Cursor AI editor. It must never appear in the agent list.
+ const nativeCursorHelper =
+ '/System/Library/PrivateFrameworks/TextInputUIMacHelper.framework/Versions/A/XPCServices/CursorUIViewService.xpc/Contents/MacOS/CursorUIViewService';
+ mockExecWith((cmd) =>
+ cmd.includes('cursor')
+ ? `6001 1 0.0 0.1 02:00 ${nativeCursorHelper}\n` +
+ '6002 1 0.5 0.2 01:00 /usr/local/bin/cursor-agent --print\n'
+ : ''
+ );
+
+ const agents = await getRunningAgents();
+ const pids = agents.map(a => a.pid);
+ expect(pids).not.toContain(6001);
+ expect(pids).toContain(6002);
+ });
+
it('skips lines containing "grep" or "ps -eo"', async () => {
mockExecWith(
'5000 1 0.0 0.0 00:01 grep claude\n' +
@@ -240,6 +259,34 @@ describe('agents.js', () => {
});
});
+ // ===========================================================================
+ // isAgentProcessCommand — pure predicate
+ // ===========================================================================
+ describe('isAgentProcessCommand', () => {
+ it('accepts real agent CLI invocations', () => {
+ expect(isAgentProcessCommand('/usr/local/bin/claude --print')).toBe(true);
+ expect(isAgentProcessCommand('/usr/local/bin/cursor-agent --print')).toBe(true);
+ expect(isAgentProcessCommand('codex')).toBe(true);
+ });
+
+ it('rejects the scanner itself and its grep', () => {
+ expect(isAgentProcessCommand('grep -i cursor')).toBe(false);
+ expect(isAgentProcessCommand('ps -eo pid,command')).toBe(false);
+ });
+
+ it('rejects macOS app bundles, framework, and XPC helpers', () => {
+ expect(isAgentProcessCommand('/Applications/Cursor.app/Contents/MacOS/Cursor')).toBe(false);
+ expect(isAgentProcessCommand(
+ '/System/Library/PrivateFrameworks/TextInputUIMacHelper.framework/Versions/A/XPCServices/CursorUIViewService.xpc/Contents/MacOS/CursorUIViewService'
+ )).toBe(false);
+ });
+
+ it('rejects empty/undefined commands', () => {
+ expect(isAgentProcessCommand('')).toBe(false);
+ expect(isAgentProcessCommand(undefined)).toBe(false);
+ });
+ });
+
// ===========================================================================
// killProcess
// ===========================================================================