diff --git a/tui_gateway/session_compression.py b/tui_gateway/session_compression.py index 1afdf07138..0d76db9e3d 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: return try: - 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.py index b9226f5efd..a5cc237412 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, *, attemp def 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: