Skip to content

The agent that grows with you

fix(tui_gateway): report desktop_contract in all lazy session-info shapes

ethernet35ade5719d66
diff --git a/tui_gateway/agent_callbacks.py b/tui_gateway/agent_callbacks.py
index 53c8dacb429..7b1d62440b3 100644
--- a/tui_gateway/agent_callbacks.py
+++ b/tui_gateway/agent_callbacks.py
@@ -148,7 +148,8 @@ def _apply_project_workspace(task_id: str, path: str, _name: str = "") -> None:
agent = session.get("agent")
info = _session_info(agent, session) if agent is not None else {
"cwd": resolved, "branch": git_probe.branch(resolved),
- "project": _project_info_for_cwd(resolved), "lazy": True}
+ "project": _project_info_for_cwd(resolved), "lazy": True,
+ "desktop_contract": DESKTOP_BACKEND_CONTRACT}
_emit("session.info", sid, info)
except Exception:
logger.debug("failed to emit session.info after project workspace move", exc_info=True)
diff --git a/tui_gateway/methods_session.py b/tui_gateway/methods_session.py
index d111623a890..9d26a05c905 100644
--- a/tui_gateway/methods_session.py
+++ b/tui_gateway/methods_session.py
@@ -111,7 +111,8 @@ def _cwd_info(session: dict, cwd: str, branch=None) -> dict:
if (agent := session.get("agent")) is not None:
return _session_info(agent, session)
return {"cwd": cwd, "branch": git_probe.branch(cwd) if branch is None else branch,
- "project": _project_info_for_cwd(cwd), "lazy": True}
+ "project": _project_info_for_cwd(cwd), "lazy": True,
+ "desktop_contract": DESKTOP_BACKEND_CONTRACT}
def _session_row_summary(row: dict, *, tip_row: dict | None = None, resolved_id=None) -> dict:
@@ -583,7 +584,8 @@ def _resume_live_unpersisted(ctx: _Resume, live_sid: str, live: dict) -> dict:
return _ok(ctx.rid, _attach_todo_state({
"session_id": live_sid, "stored_session_id": str(live.get("session_key") or ""),
"message_count": len(messages), "messages": messages,
- "info": {"model": _resolve_model(), "lazy": True, "profile_name": profile_name_for_home(live.get("profile_home")) or _response_profile_name(ctx.profile)}}, live))
+ "info": {"model": _resolve_model(), "lazy": True, "desktop_contract": DESKTOP_BACKEND_CONTRACT,
+ "profile_name": profile_name_for_home(live.get("profile_home")) or _response_profile_name(ctx.profile)}}, live))
def _resume_adopt_stranded(ctx: _Resume) -> None: