refactor: route the /loop wakeup send through _notif_submit

The hand-rolled try/except around message.start + _run_prompt_submit
duplicated _notif_submit, which already emits the start event, submits,
and releases the claimed turn on failure (and logs why). One release
path per claim site keeps the leak fix in one place.
This commit is contained in:
teknium1
2026-09-20 00:04:31 -07:00
committed by Teknium
parent 13ae7f7826
commit e787529064

View File

@@ -189,12 +189,8 @@ def _notif_slash_loop_tick(rid: str, sid: str, session: dict, mgr, wakeup: str)
if not _notif_claim_turn(session):
mgr.abandon_tick()
return
try:
_emit("message.start", sid)
_run_prompt_submit(rid, sid, session, payload["message"])
except Exception:
_notif_release_turn(session) # the swallow below would otherwise leave the session busy for good
raise
# Releases the claim on failure: the swallow below would otherwise leave the session busy for good.
_notif_submit(rid, sid, session, payload["message"], "loop wakeup send failed")
return
except Exception:
pass