fix(desktop): restore activeBotRoute dropped by merge 0404020f7b - #92811
fix(desktop): restore activeBotRoute dropped by merge 0404020f7b#92811ZhiPengH wants to merge 1 commit into
Conversation
Merge 0404020 kept both call sites of activeBotRoute() (useRoster's queryFn and sweepBotProfileSessions) but dropped the function definition introduced in 9b7ab9d. The bundled plugin therefore throws ReferenceError: activeBotRoute is not defined on the roster's first fetch; because useRoster sets retry: true, React Query retries forever and the Bots pane paints an eternal loading spinner. Restore the definition verbatim from 9b7ab9d. The sweep call site also recovers: it failed silently inside its try/catch, so bot-profile session cleanup had stopped running. Verified: 406/406 hermes-bots plugin tests pass; built bundle carries the definition again and the Bots pane loads on a locally packaged app.
|
Independent reproduction and live validation on macOS ARM64:
Local verification after the restoration:
One coverage gap is worth closing here: the existing 406-test Bot Mode suite stayed green while the symbol was missing. A regression should invoke This independently confirms the root cause and the minimal restoration in this PR. The broader state-db lock/retry work in #92793 appears adjacent rather than required to reproduce this specific empty-roster regression. |
|
Independently hit this on a two-machine install and excavated the same answer before spotting your PR (#92835, now closed as a duplicate of this) — so consider this a verification report: restoring the function exactly as 9b7ab9d wrote it takes the Bots pane from a permanently spinning roster (8+ minutes against a healthy gateway; the ReferenceError is swallowed by useRoster's If useful: #92835 carries a 4-case behavior test for the restored function whose extraction step fails whenever the definition is lost while the call sites survive — the exact merge-casualty mode that shipped this, and one nothing else gates (plugin.js sits outside eslint's |
|
Follow-up after validating the latest fetched Commit requestForBot(activeBot, 'profiles.list', {})Current source-contract check on Fresh detached-worktree canary on The suite now includes the source contract So the |
|
Closing as implemented-on-main — the missing |
Symptom
The Desktop Bots pane shows an eternal loading spinner (no agents, no error card) on current
main. Every 5s poll fails silently.Root cause
Merge 0404020 (PR #90006) kept both call sites of
activeBotRoute()—useRoster()'squeryFn(line ~3906)sweepBotProfileSessions()(line ~1636)— but dropped the function definition introduced in 9b7ab9d. The bundled plugin therefore throws
ReferenceError: activeBotRoute is not definedon the roster's first fetch. BecauseuseRostersetsretry: true(there for slow remote gateways), React Query retries forever and the pane never leaves theisLoading && !roster.lengthbranch.The sweep call site fails silently inside its try/catch, so bot-profile session cleanup (hiding 'Bot Chat' / 'Agent Inbox' plumbing rows) had also stopped running — a second, quieter casualty of the same drop.
Fix
Restore the definition verbatim from 9b7ab9d. One file, +25 lines, no behavior change beyond un-breaking the two call sites.
Verification
node --test src/plugins/hermes-bots/tests/*.test.mjs— 406/406 passNo route for active botbody present, 2 call sites resolve)Found while debugging a live install today; symptom appeared exactly when the auto-updater landed the merge range containing 0404020.