Skip to content

fix(providers): raise default stream first-byte deadline to 60s - #439

Merged
caigee-cmd merged 1 commit into
mainfrom
fix/stream-ttfb-60s
Oct 29, 2026
Merged

caigee-cmd merged 1 commit into
mainfrom
fix/stream-ttfb-60s

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Qoder and WorkBuddy abandoned a stream that had not sent its response head within 30s. Thinking-model cold starts regularly take longer, so the request failed over — and waited another full deadline on the next account — before the upstream had a chance to answer.
  • The default is now 60s on both sides that implement a first-byte deadline: Qoder (internal/providers/qoder/worker.go and worker/src/upstream.mjs, so the worker and the gateway still agree) and WorkBuddy (internal/providers/workbuddy/ttfb.go). QODER_STREAM_TTFB_MS and WORKBUDDY_STREAM_TTFB_MS still override it, with the same 5s floor.
  • Not changed: the 10s cooldown after a first-byte timeout, and Qwen Work's separate 30s wait for a meaningful SSE data line after the response head.

Test plan

  • go test ./internal/providers/qoder/ ./internal/providers/workbuddy/
  • cd worker && npm test (87 pass)
  • QODER_STREAM_TTFB_MS=30000 still restores the old deadline for a deployment that wants it

Qoder and WorkBuddy abandoned a stream that had not sent its response
head within 30s. Thinking-model cold starts regularly take longer than
that, so the request failed over (and waited another full deadline on
the next account) before the upstream had a chance to answer.

60s is still short of the client's patience, and QODER_STREAM_TTFB_MS /
WORKBUDDY_STREAM_TTFB_MS keep the old deadline available per deployment.
The worker default moves with the Go side so the two agree.
@caigee-cmd
caigee-cmd merged commit ad2fdfd into main Oct 29, 2026
5 of 6 checks passed
@caigee-cmd
caigee-cmd deleted the fix/stream-ttfb-60s branch October 29, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant