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

Merge pull request #2577 from atomantic/claim/issue-2549

[._.]/ Adam Eivy1e5a0dce7d83
diff --cc .changelog/NEXT.md
index 7bddbdf011,cd9fe7d8e2..4cb3eaebb2
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@@ -18,8 -18,8 +18,9 @@@
## Fixed
+- **[issue-2543] Cancel stale ⌘K global search responses and clear the Security device-change restart timer.** The command palette's global `search(query)` effect debounced the request but had no in-flight guard, so a slow response for an older query could resolve after the user typed on and overwrite the newer query's results (or flip the loading spinner off prematurely) — the sibling catalog-search effect already used a `cancelled` flag. The global-search effect now mirrors that `cancelled` guard so only the latest query's response applies. Separately, `Security.jsx`'s device-change handler scheduled `setTimeout(startMedia, 100)` with no clear on unmount or before rescheduling, so rapid device switches stacked multiple `startMedia()` calls and a navigation-away could fire the restart into an unmounted component; the timer id is now held in a ref, cleared before each reschedule, and cleared in an unmount cleanup effect. A regression test asserts a stale search response can't clobber the current query's results.
- **POST session run page crashed (React error #130) when transitioning into a cognitive drill.** `DrillTransition.jsx`'s `DOMAIN_ICONS` map was missing a `cognitive` entry, yet `DRILL_TO_DOMAIN` maps every cognitive drill type (n-back, digit-span, stroop, schulte-table, mental-rotation, reaction-time) to the `cognitive` domain — so finishing a drill whose successor was a cognitive drill (e.g. a Doubling Chain followed by a cognitive drill) resolved the transition-card icon to `undefined` and blanked the run page with a minified React error. Added the `cognitive: Brain` icon and hardened the lookup to fall back to `ChevronRight` for any unmapped domain, so a future domain gap degrades gracefully instead of crashing. A regression test renders the transition for every `DRILL_TO_DOMAIN` type.
+ - **[issue-2549] Enforce the Windows `.exe` basename contract in the CoS Runner allowlist test.** The `allowedCommands.test.js` case for a Windows absolute path (`C:\\...\\claude.exe`) ended on `expect(typeof result).toBe('boolean')`, which passes for any boolean — so on POSIX CI the Windows path handling was never actually asserted and a regression would go unnoticed. It's replaced with concrete assertions: a POSIX-style `.exe` path (`/opt/tools/claude.exe`) that exercises the basename-then-strip logic deterministically on every OS (allowed), a matching rejection for a non-allowlisted `.exe` (`/opt/tools/bash.exe`), and a per-platform assertion for the real backslash form that expects `true` on `win32` and `false` on POSIX (where `path.basename` doesn't split backslashes). Both new assertions were verified to fail against a broken implementation (dropping the `.exe` strip; forcing `win32` basename on POSIX). Test-only change — no runtime behavior change.
- **[issue-2536] Catch unhandled rejections from Telegram handlers and health/probe timers.** Several async boundaries were fire-and-forget: the Telegram client dispatched `onText`/`emitter.on` handlers without awaiting or catching, `telegram.js` ran `setInterval(healthCheck)` and a couple of sync-context `bot.sendMessage(...)` calls without a `.catch`, and `instances.js` scheduled `probeAllPeers()` from `setTimeout`/`setInterval` without one — so a rejected handler or a failed fs/network read leaked an unhandled promise rejection (process-killing on Node ≥15). The client now routes every handler invocation through a `runHandler` wrapper that logs a single emoji-prefixed line on rejection; the health-check interval and both probe timers wrap their async callback in `.catch`; and the `/start`, `/help`, and unauthorized-notice sends now await or `.catch` their promise. A vitest suite drives the client's `onText` and `message` paths with a throwing handler and asserts no `unhandledRejection` escapes.
- **[issue-2519] CoS handlers no longer flash a false-success toast after a failed API call.** Several Chief of Staff actions (`handleForceEvaluate` on the CoS page, the Tasks tab "Run Now" button, and the Config tab's Save + autonomy-level change) `.catch`-swallowed the request rejection and then unconditionally toasted success and mutated optimistic UI — so a network/server error still read as "done." Each now awaits inside try/catch and only toasts success / advances state after the request resolves: a failed Save keeps the editor open, and a failed autonomy-level change reverts the optimistic form params. Errors surface via a single `toast.error` (the calls already pass `{ silent: true }`).
- **[issue-2520] Pass `{ silent: true }` on client API calls that own a custom error toast.** Several call sites routed a request through the auto-toasting `request()` helper AND showed their own `toast.error` in `.catch`, so a failure surfaced two stacked toasts. The music managers (Artists/Albums/Tracks load + create/update/delete), MusicVideo (list/create/delete/analyze/plan/add-scene/delete-scene/reorder), and DataDog (load/save/delete/test) now pass `{ silent: true }` on those calls; CharacterSheet's local `charGet`/`charPost`/`charPut` helpers are silent-by-default (every caller owns its own catch toast or the `loadError` banner) with an opt-out. Each failing action now shows a single toast.