fix(desktop): bump backend contract so profile-routing version skew is surfaced - #40017
Closed
OutThisLife wants to merge 1 commit into
Closed
fix(desktop): bump backend contract so profile-routing version skew is surfaced#40017OutThisLife wants to merge 1 commit into
OutThisLife wants to merge 1 commit into
Conversation
…urfaced #39921/#39993 added per-session profile routing to the WS backend (session.create / session.resume accept `profile`; the backend builds the agent and persists against that profile's home/state.db). The desktop already sends `profile`, but a backend on OLD code silently ignores it — new chats land in the launch profile and "who are you" answers as the wrong profile. This bites anyone whose backend is a SEPARATE install from the desktop — the common remote case: update the desktop app, but the remote VM's Hermes is still old. Both still reported DESKTOP_BACKEND_CONTRACT = 1, so the desktop's existing skew guard (reportBackendContract → "Backend out of date" toast with one-click update) never fired. The user just sees silent cross-profile leakage with no clue why. Bump the contract on both sides to 2: - tui_gateway/server.py: DESKTOP_BACKEND_CONTRACT = 2 (with version history note). - apps/desktop/src/store/updates.ts: REQUIRED_BACKEND_CONTRACT = 2. Now a profile-routing-aware desktop pointed at a pre-#39921 backend sees the backend report contract 1 < required 2 → the "Backend out of date" warning fires instead of silently misrouting sessions. No behavior change when desktop and backend are updated together (the single-machine case).
Contributor
🔎 Lint report:
|
This was referenced Jun 5, 2026
6 tasks
5 tasks
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
A "still broken after updating" report turned out to be version skew, not a code bug — and the real lesson is that nothing warned the user.
His desktop app was on #39993, but his backend runs on a separate VM still on #39991 (pre-fix). The per-session profile fixes (#39921/#39993) live in
tui_gateway/server.py— the backend. He updated the desktop; the VM's Hermes stayed old. So the desktop dutifully sentprofile: Sonsession.create, the old backend ignored it, and new chats silently landed in the launch (default/"A") profile — exactly the reported symptom.Why it reproduced for nobody on the team: we all test desktop + backend on one machine, where a single update covers both. Remote/VM users update the two halves independently.
Root cause of the silent failure
The desktop already has a skew guard —
reportBackendContract()shows a "Backend out of date" toast with one-click update when the backend reports an olderdesktop_contract. But when #39921/#39993 changed the WS protocol (addedprofiletosession.create/session.resume), neither contract constant was bumped. Both stayed at1, so a profile-routing-aware desktop happily drove a profile-blind backend with no warning.Fix
Bump the GUI↔backend contract to
2on both sides:tui_gateway/server.py:DESKTOP_BACKEND_CONTRACT = 2(+ version-history comment).apps/desktop/src/store/updates.ts:REQUIRED_BACKEND_CONTRACT = 2.Now a #39993+ desktop pointed at a pre-#39921 backend sees
contract 1 < required 2→ the existing "Backend out of date" warning fires (with one-click align) instead of silently misrouting sessions.Notes
Test plan
tsc -bclean.main).