Files
hermes-agent/tests/e2e
Teknium 3e6241a819 test(relay): the OpenAI-stream e2e no longer deadlocks when Relay's finalizer has not started yet
Relay's producer is pumped by the consumer thread's own event loop (ManagedLlmStream.__next__ -> run_until_complete), so the finalizer can only START inside a consumer next(). The harness blocked the consumer in _count_chunk waiting for the finalizer to start; when the loop had not reached it yet by the final chunk, that wait could never be satisfied and expired at 5 s. Reproduced ~1 run in 6 locally with a thread dump (consumer parked in Event.wait, no other thread anywhere near Relay); it took two unrelated PRs red in CI the same day (#103476, #103486).

The hook now forces the ordering only when the finalizer has already started (that is the race under test), releases it otherwise, reports whether the race was forced, and the two tests repeat the stream until it was, asserting the invariant on every run. 15/15 green; with 74de0fd4fe's agent/ change reverted the tool-call test still fails 3/3, so it keeps guarding what it pins.
2026-09-06 09:03:59 -07:00
..