fix(desktop): hydrate canonical Bot Chats on profile switch - #89284
citizendev9c wants to merge 1 commit into
Conversation
Independent verification — this PR fixes the blank Bot Mode pane for meReproduced #89206 on a local (non-SSH) setup, then confirmed this PR resolves it. BeforeOn a fresh launch of the packaged v0.20.4 app, the primary bot (
(Profile names redacted — they're work projects.) Two details that match the "not data loss" reading in the issue:
Restarting the app did not help. AfterApplied this PR to All four bots now open their transcripts, including the three that were blank. Switching between them repeatedly, and clicking a non-primary bot first on a cold start, no longer reproduces it. The Python gateway was running stock
Environment
|
|
Merged via PR #89394 — your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks for the deep diagnostic work on this one; the hydration-await design and the SSH ownership tightening landed as-is. On top of it we reworked the resume gate to also fire on the cold-open shape from #89206 (selection not yet settled) and widened the same contract to the profile session browser open path. |
|
Follow-up live validation: PR #89284’s automated tests, typechecks, and package build passed. The packaged build could load a primary/default Bot Chat, but a cold named-profile Chat still timed out during hydration. I also tested the proposed #89843 I’ve added the detailed findings to #89843: #89843 (comment) |
What does this PR do?
Fixes Bot Mode profile switches that can leave the Desktop main surface blank even though the target bot's canonical session and persisted history still exist.
The switch now completes only after the target profile is active, the canonical Bot Chat owns the main route, and the main transcript is hydrated (or the session is explicitly known to be empty). It also tightens SSH-managed backend ownership proof so stale cleanup does not mistake a foreign process for a Desktop-owned backend.
Addresses #89206.
Related Issue
Type of Change
Changes Made
serve, and post-serve--isolatedoption placement.How to Test
Verification run on macOS arm64 / Node 26
node ../../node_modules/vitest/vitest.mjs run --project ui→ 4,780 passednode ../../node_modules/vitest/vitest.mjs run --project electron→ 1,433 passed / 2 skippednode --test src/plugins/hermes-bots/tests/*.test.mjs→ 261 passednpm run build→ PASSpython3 scripts/check-windows-footguns.py --diff origin/main→ no findings (no Python files changed)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass (N/A: Desktop TypeScript/Electron-only change; Desktop suites above were run)Documentation & Housekeeping
cli-config.yaml.example— N/A; no config keys changedCONTRIBUTING.mdorAGENTS.md— N/A; no workflow contract changedScreenshots / Logs
Automated regression coverage and exact gate counts are included above. A packaged live-client smoke is tracked separately because the running Desktop client is on a remote macOS machine, while the implementation and build host is the SSH gateway host.