fix(bot-mode): hide sweep and chat adoption can no longer swallow ordinary sessions (salvage #89901) - #90358
Conversation
૮ >ﻌ< ა ci reviewran on 734b535 — fix(bot-mode): protect ordinary sessions from hide sweep
|
|
Following up from the same production repro documented on #89901 (comment 5349681846) — posting here since this is the salvage branch where the merge decision lands. Two notes on the current diff, neither blocking: 1. Old-backend edge in 2. Recovery for sessions already hidden is still open. This PR stops new wrongful hides; rows hidden before the fix stay hidden — no surface offers a way back out of the flag today (raw SQL on state.db is the only path, which is how the repro case was restored). Companion PR #90388 adds |
…tions seen in CI) test_progress_advances_while_the_orchestrator_blocks raced its subject on both edges within one hour of PR CI (#90358): - Run 1: sampled right after the shim URL printed, before the orchestrator published its stage — caught the page boot default ('Hermes will open once done.' != 'Testing quiet update'). - Run 2 (rerun): with HOLD=4s on a slow runner, the second sample slid past the hold and caught the cleared terminal state ('' != 'Testing quiet update'). Fix: wait (<=10s) for the published stage to actually land before starting the 1.5s stability window, and raise the hold to 10s so both samples land inside it. Same assertions, same contract — just anchored to the event the test is about instead of wall-clock luck.
…tions seen in CI) test_progress_advances_while_the_orchestrator_blocks raced its subject on both edges within one hour of PR CI (NousResearch#90358): - Run 1: sampled right after the shim URL printed, before the orchestrator published its stage — caught the page boot default ('Hermes will open once done.' != 'Testing quiet update'). - Run 2 (rerun): with HOLD=4s on a slow runner, the second sample slid past the hold and caught the cleared terminal state ('' != 'Testing quiet update'). Fix: wait (<=10s) for the published stage to actually land before starting the 1.5s stability window, and raise the hold to 10s so both samples land inside it. Same assertions, same contract — just anchored to the event the test is about instead of wall-clock luck.
Summary
Bot Mode's hide sweep and canonical-chat adoption can no longer claim or hide a user's ordinary conversation — every hide/adopt/re-anchor path now verifies the target is actual Bot Mode plumbing (title "Bot Chat", or root title across compression) and fails closed.
Salvages PR #89901 by @Owen-narcissus onto current main with authorship preserved (clean cherry-pick, zero conflicts against the merged #90326 activity work).
Changes
apps/desktop/src/plugins/hermes-bots/plugin.js:hideOwnedBotSessions()resolves every stored canonical pointer throughprofiles.listpreferred_session_idsand requires the "Bot Chat" title beforesession.set_hidden— a stale pointer at an ordinary session is never hidden (fail-closed on old gateways too).tui_gateway/methods_profiles.py:preferred_sessiongainsroot_title(durable pin's own title) so compression-rotated Bot Chats ("Bot Chat (continued)") still verify.Validation
node --test tests/*.test.mjs(hermes-bots)pytest tests/tui_gateway/test_profiles_list_preferred_session.pynode --check plugin.jsInfographic