Skip to content

fix(desktop): report desktop_contract in lazy session.create info#36112

Merged
OutThisLife merged 1 commit into
mainfrom
bb/fix-lazy-session-contract
May 31, 2026
Merged

fix(desktop): report desktop_contract in lazy session.create info#36112
OutThisLife merged 1 commit into
mainfrom
bb/fix-lazy-session-contract

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • The desktop GUI's "Backend out of date" toast fires from reportBackendContract(info.desktop_contract), which treats a missing contract as a pre-GUI/old backend.
  • The full _session_info() always reports desktop_contract: 1, but the lazy session.create path hand-builds a partial info dict that omitted it.
  • Since the desktop creates a session on every launch, desktop_contract came through as undefined → false "Backend out of date" warning every time, regardless of how current the backend actually was (updating never silenced it).
  • Fix: include DESKTOP_BACKEND_CONTRACT in the lazy payload, matching what resume/branch already do via _session_info.

Test plan

  • Added test_session_create_lazy_info_reports_desktop_contract — asserts the lazy session.create info carries desktop_contract == DESKTOP_BACKEND_CONTRACT (regression guard for the false toast).
  • scripts/run_tests.sh tests/test_tui_gateway_server.py → 191 passed.

The lazy session.create path hand-builds a partial info dict that omitted
desktop_contract. The desktop GUI reads a missing contract as undefined and
treats it as an out-of-date backend, so it surfaced a "Backend out of date"
toast on every launch even against a current backend. Carry the contract in
the lazy payload like _session_info already does for resume/branch.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/fix-lazy-session-contract vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9554 on HEAD, 9552 on base (🆕 +2)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4953 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the desktop GUI backend contract reporting for lazy session.create responses so the desktop does not treat current backends as out of date when launching.

Changes:

  • Adds desktop_contract to the lazy session info payload, matching full _session_info() behavior.
  • Adds a regression test asserting lazy session.create includes the backend contract version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tui_gateway/server.py Includes DESKTOP_BACKEND_CONTRACT in lazy session creation info.
tests/test_tui_gateway_server.py Adds coverage for the lazy session contract field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OutThisLife OutThisLife merged commit 77bb648 into main May 31, 2026
22 checks passed
@OutThisLife OutThisLife deleted the bb/fix-lazy-session-contract branch May 31, 2026 23:23
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 31, 2026

@mxnstrexgl mxnstrexgl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — automated review passed. No security, quality, or test coverage issues detected.

JoeKowal pushed a commit to JoeKowal/hermes-agent that referenced this pull request Jun 4, 2026
…usResearch#36112)

The lazy session.create path hand-builds a partial info dict that omitted
desktop_contract. The desktop GUI reads a missing contract as undefined and
treats it as an out-of-date backend, so it surfaced a "Backend out of date"
toast on every launch even against a current backend. Carry the contract in
the lazy payload like _session_info already does for resume/branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants