fix(integration): _tour_request keeps the verdict on an empty-but-registered session record

The r3 collapse to '_sessions.get(sid) or {}' treated a registered-but-empty session dict as
detached, writing the tour_bridge verdict to a throwaway — so an unanswered probe was re-paid
on every action. Restore the 'is None' distinction.
This commit is contained in:
Teknium
2026-09-03 02:47:37 -07:00
parent 48b336ef7e
commit 545e374a68
+3 -1
View File
@@ -1405,7 +1405,9 @@ def _tour_request(sid: str, payload: dict) -> str:
session's first action gets the short probe deadline; an unanswered probe marks the bridge
unavailable for that session; once a client has answered, actions get the full deadline. The
verdict lives on the session record, so a new session re-probes."""
session = _sessions.get(sid) or {} # detached caller: throwaway record, plain bridge, unprobed
session = _sessions.get(sid)
if session is None: # detached caller: throwaway record, plain bridge, unprobed (empty record != detached)
session = {}
state = session.get("tour_bridge")
if state == "unanswered":
return _TOUR_BRIDGE_UNAVAILABLE