Skip to content

fix(desktop/bots): restore activeBotRoute — the Bots roster loads again - #92835

Closed
jonpol01 wants to merge 1 commit into
NousResearch:mainfrom
jonpol01:fix/bots-roster-missing-activebotroute
Closed

fix(desktop/bots): restore activeBotRoute — the Bots roster loads again#92835
jonpol01 wants to merge 1 commit into
NousResearch:mainfrom
jonpol01:fix/bots-roster-missing-activebotroute

Conversation

@jonpol01

Copy link
Copy Markdown
Contributor

Problem

The Bots tab never loads on current main — every install shows the "Waking up …" spinner forever
and the roster never populates.

useRoster's queryFn and sweepBotProfileSessions' cold path both call activeBotRoute(), but
the function is defined nowhere: the #90006 reconciliation merge (0404020f7b) dropped the
definition while keeping both call sites. It exists in exactly one commit in history — the
feature commit 9b7ab9d65a:

git log --all -S "function activeBotRoute" -- apps/desktop/src/plugins/hermes-bots/plugin.js
9b7ab9d65a feat(desktop): route remote bot actions by connection

Every roster fetch throws ReferenceError: activeBotRoute is not defined, and useRoster's
retry: true (kept deliberately for slow SSH gateways) masks it as a permanent loading state
instead of an error card.

Why no gate caught it: plugin.js sits outside every one. The eslint config's file set is
**/*.{ts,tsx} only, so the file is never linted and no-undef never ran; tsc does not see
.js; and the plugin's node tests deliberately evaluate slices of the file, never the whole
module. Verified against main @ 5c1a304ce8: still two call sites, zero definitions.

Change

Restore the function verbatim from 9b7ab9d65a, placed beside its routing siblings
(botConnectionRoute / requestForBot), with a comment recording how it was lost so the next
reconciliation has a landmark.

Testing

tests/active-bot-route.test.mjs (4 behavior tests through the same vm extraction the suite
already uses):

  • resolves the active (connection, profile) pair to its route
  • a legacy host without profileRoutes resolves to null (local path)
  • a multi-source host with no route for the active bot fails loudly
  • a single-source host with no matching route falls back to null

The extraction step asserts the definition exists, so this file is also the regression guard for
the exact failure mode: a future merge that keeps the call sites but loses the definition fails
these tests instead of shipping a spinner. Reverting the fix: 4/4 fail. Full plugin suite on the
rebased head: 415/415.

Live verification: a desktop build without this change reproduces the permanent "Waking up …"
(roster absent after 8+ minutes against a healthy gateway); with it, the same install's roster
populates in ~3 seconds with local and remote-connection rows.

The NousResearch#90006 reconciliation merge (0404020) dropped the definition of
activeBotRoute() while keeping both of its call sites (useRoster's queryFn
and sweepBotProfileSessions' cold path). plugin.js sits outside every gate
that could have noticed — the eslint file set is *.{ts,tsx} only, tsc does
not see .js, and the plugin tests evaluate slices rather than the module —
so main ships a ReferenceError on every roster fetch. useRoster's
retry: true (kept for slow SSH gateways) turns that into a permanent
"Waking up ..." spinner: the Bots tab never populates, for every user, on
every install.

Restore the function exactly as 9b7ab9d wrote it, placed beside its
routing siblings (botConnectionRoute / requestForBot), and pin it with
behavior tests whose extraction step fails if the definition is ever lost
again while the call sites survive.
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Aug 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #92811: the restoration mechanism and target function are the same. #92811 is the earlier open focused fix.

@jonpol01

Copy link
Copy Markdown
Contributor Author

Confirmed duplicate — #92811 is the earlier PR and restores the function identically (same excavation, same placement). Closing in its favor.

One thing this PR carries that #92811 doesn't: a regression test (tests/active-bot-route.test.mjs, 4 behavior cases) whose vm-extraction step fails if the definition is ever lost-but-called again — the exact failure mode of the 0404020 merge, which no gate can catch (plugin.js is outside the eslint file set and tsc, and the node tests run slices). Happy for anyone to lift it into #92811 or a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants