The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(tui): hug marker clear/model-switch calls
Tekniumf70b49949493
diff --git a/tui_gateway/session_compression.py b/tui_gateway/session_compression.pyindex 1afdf071384..0d76db9e3dc 100644--- a/tui_gateway/session_compression.py+++ b/tui_gateway/session_compression.py@@ -162,11 +162,9 @@ def _apply_pending_model_switch(sid: str, session: dict) -> None:if not pending or session.get("agent") is None:returntry:- result = _apply_model_switch(- sid, session, pending["raw"], confirm_expensive_model=bool(pending.get("confirm_expensive_model"))- )- # Honour the expensive-model confirm: surface the warning and drop the switch rather than- # spend on a model the user never confirmed.+ result = _apply_model_switch(sid, session, pending["raw"], confirm_expensive_model=bool(pending.get("confirm_expensive_model")))+ # Honour the expensive-model confirm: surface the warning and drop the switch rather than spend+ # on a model the user never confirmed.if result.get("confirm_required"):_emit("error", sid, {"message": result.get("confirm_message") or result.get("warning") or ""})except Exception as e:diff --git a/tui_gateway/turn_marker.py b/tui_gateway/turn_marker.pyindex b9226f5efd0..a5cc237412c 100644--- a/tui_gateway/turn_marker.py+++ b/tui_gateway/turn_marker.py@@ -96,10 +96,7 @@ def record_turn_start(home: Path | str, session_key: str, prompt: str, *, attempdef clear_turn_marker(home: Path | str, session_key: str) -> None:"""Remove the marker once its turn concluded (any outcome the client saw)."""if session_key:- _update(- home, session_key,- lambda e: {k: v for k, v in e.items() if k != session_key} if session_key in e else None, "clear",- )+ _update(home, session_key, lambda e: {k: v for k, v in e.items() if k != session_key} if session_key in e else None, "clear")def read_turn_marker(home: Path | str, session_key: str) -> dict[str, Any] | None: