fix(desktop): report desktop_contract in lazy session.create info#36112
Conversation
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.
🔎 Lint report:
|
There was a problem hiding this comment.
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_contractto the lazy session info payload, matching full_session_info()behavior. - Adds a regression test asserting lazy
session.createincludes 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.
mxnstrexgl
left a comment
There was a problem hiding this comment.
LGTM — automated review passed. No security, quality, or test coverage issues detected.
…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.
Summary
reportBackendContract(info.desktop_contract), which treats a missing contract as a pre-GUI/old backend._session_info()always reportsdesktop_contract: 1, but the lazysession.createpath hand-builds a partialinfodict that omitted it.desktop_contractcame through asundefined→ false "Backend out of date" warning every time, regardless of how current the backend actually was (updating never silenced it).DESKTOP_BACKEND_CONTRACTin the lazy payload, matching what resume/branch already do via_session_info.Test plan
test_session_create_lazy_info_reports_desktop_contract— asserts the lazysession.createinfo carriesdesktop_contract == DESKTOP_BACKEND_CONTRACT(regression guard for the false toast).scripts/run_tests.sh tests/test_tui_gateway_server.py→ 191 passed.