fix(desktop): Bot Mode chats no longer paint blank when switching between running bots - #89902
Merged
Conversation
…ween running bots
resolveStoredSession never probed the ACTIVE profile: the unscoped
/api/sessions GET routes to the PRIMARY backend (not the active
gateway's), and the cross-profile probe loop explicitly skipped the
active key. A hidden Bot Mode canonical chat — never present in the
sidebar cache — owned by the focused bot therefore resolved to
undefined on every switch. The transcript prefetch then went unscoped
to the primary backend, 404'd, and the thread painted empty until the
user opened the session explicitly via right-click → Sessions (which
seeds the cache with a profile-stamped row).
Probe the active profile first in the by-id ladder, so hidden and
uncached sessions on the focused profile resolve with ownership and the
prefetch routes to the owning backend.
Live-repro'd headless via CDP with 3 bot profiles mid-turn: before the
fix every focus-switch painted a blank thread ('Waking up <bot>…');
after, the full transcript paints. Reported by @tbkbossswaglord.
Contributor
૮ >ﻌ< ა ci reviewran on afcf4ba — chore: retrigger CI (zero-job dispatch failure, auto-heal)
|
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bot Mode chats no longer paint a blank thread when switching focus between bots — the session resolver now probes the ACTIVE profile, which was the one profile it never checked.
Reported by @tbkbossswaglord on X: with 3 bots running, focusing another bot left the middle pane empty; the only workaround was right-click → Sessions → reopen (and only when the bot had multiple sessions).
Root cause:
resolveStoredSession's by-id ladder assumed the unscoped/api/sessions/{id}GET covered the active profile, but Electron routes profile-less REST to the PRIMARY backend — so a session owned by the active non-primary profile 404s there, and the cross-profile probe loop explicitly skipped the active key. Hidden Bot Mode canonical chats are never in the sidebar cache, so every focus switch resolved toundefined, the transcript prefetch went unscoped to the primary backend, 404'd, and the thread painted empty. Opening via right-click → Sessions seeded the cache with a profile-stamped row, which is exactly why the reporter's workaround worked.Changes
apps/desktop/src/app/session/hooks/use-session-actions/utils.ts: probe the active profile first in the by-id resolution ladder instead of skipping it.apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts: regression test for the hidden-Bot-Mode-chat shape (unscoped 404 → active-profile probe resolves ownership); existing probe-order tests updated for the new sequence.Validation
Repro was fully headless: built desktop from this branch, seeded 3 bot profiles in a scratch HERMES_HOME, drove real clicks + prompts over CDP, and diffed the painted DOM against each profile's state.db. Console tracing pinned the exact drop point (
resolved profile: undefined→ unscoped prefetch) before the fix; after the fix the trace showsprobe hit on <bot>and the transcript paints.Infographic
Infographic generation unavailable this session (FAL balance exhausted — image_generate returned "User is locked. Exhausted balance."). Will attach on regeneration.