mirror of
https://github.com/livekit/livekit.git
synced 2026-09-16 12:52:40 +00:00
handleConnection writes the register response from inside HandshakeAgentWorker and installs the worker's routes after it returns, so a worker learns it is registered a moment before the node can route to it. The conformance worker's WaitRegistered unblocks on that response and startWorker returned straight into the first request, which on a loaded runner arrived while the registry was still empty and came back 503. TestAgentEndpointsStatusMapping saw that as 503 for the first few mapped statuses, TestAgentEndpointsHOL as an unexpected EOF, reading 1024 bytes out of a short error body. The stack keeps the registry it builds and startNamedWorker waits for the worker's registration to appear in it, which is the condition the requests actually depend on. TestAgentEndpointsRetrySafety builds its unreachable worker by hand and waits the same way. The HOL test asserts its status before reading the body, so a 503 there reports as a status mismatch rather than a truncated read. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>