Files
hermes-agent/tests
David Dudok de Wit 0bf1ed99ce fix(gateway): a delete committed before its retirement runs answers not_found on resume
Resume re-authorizes after its off-loop history read, so a delete that
retired the session meanwhile answers not_found. A delete commits off
the loop, though, and its retirement runs only when the loop gets back
to it. In between, the live entry is still there and passes the
re-authorize, but the row is gone:
- session.resume read the missing row in _handle and raised TypeError,
  an internal error (-32603) for the viewer;
- the hosted room's history read met the deleted receipt and answered
  storage_unavailable.

_handle now raises not_found for a missing row, before the viewer
joins, and unless_deleted turns the history read's refusal into
not_found when the session row is gone. This also covers a delete that
starts cold, and nothing waits: holding the session's mutation lock
instead would make a resume wait behind a model switch or MCP discovery.

Refs #134889
Refs #140449

(cherry picked from commit fc14e2a30b60b8d667afde7d411cb2113441d744)
2026-10-18 04:46:34 -07:00
..
…
…