The qoder plugin 0.2.62 answers a request Qoder queues with a 200 at
once, then sends SSE comments every 10s for up to an hour before the
answer. This works only if the gateway turns each upstream comment into
an event that Codex counts. Codex's 300s idle timeout counts SSE events
and ignores comments.
TestQueuedUpstreamKeepsResponsesClientAlive has a Chat upstream that
sends ": queued in Qoder" comments only, until the Responses client has
heard 40 data events, and then the answer. The test waits on that count,
not on a duration. The client fails if it hears no data event within its
idle window. The keepalive values are scaled down: beat 20ms, hold 100ms,
agentQuietMost 200ms, translated silence 300ms, client idle 600ms.
Run on mote: `go test -count=1 -run
TestQueuedUpstreamKeepsResponsesClientAlive ./internal/gateway` ok
(events=47, upstream_comments=39). `gofmt -l` is clean.
Broken by hand: responsesEncoder.keepalive with its response.in_progress
write removed is red, "the client heard no event for 600ms" (restored).
Not tried: a real queued Qoder account.
Reported-by: real-jacket