Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d6e7bc1af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const leafTimer = setTimeout( | ||
| () => | ||
| leafDeadlineCtl.abort( | ||
| new Error("opencode-route-proxy leaf first-response timeout"), | ||
| ), | ||
| LEAF_TIMEOUT_MS, |
There was a problem hiding this comment.
Preserve a longer generation deadline for non-streaming requests
For requests with stream omitted or false, an upstream can legitimately wait until the entire completion is generated before sending response headers. Applying this 3-second timer unconditionally therefore aborts healthy non-streaming generations that take longer than three seconds, retries them on subsequent leaves, and ultimately returns 502 if none finishes within that limit. Previously these requests could complete within the existing whole-request deadline. Apply the short first-response timeout only to streaming requests, or provide a separate non-streaming deadline that accommodates full generation.
Useful? React with 👍 / 👎.
Closes #5294
Adds configurable
OPENCODE_ROUTE_PROXY_LEAF_TIMEOUT_MS(default 3000 ms) to bound each leaf request until response headers arrive. A per-leaf timeout is recorded asoutcome=timeout,error_tag=Transport, withfailed_over_to, and the walk continues; client aborts and the existing whole-walk deadline remain terminal.Adds a proxy regression test proving a hung first leaf is shed and a live second leaf completes within the client window, with both attempts recorded.
Client-side verification: OpenCode reads
input.model.routing.policy.firstTokenTimeoutMs; it is configurable viaexperimental.model_routes.<route>.health.firstTokenTimeoutMs, defaults to 10000 ms, andfalsedisables it. The proxy's 3000 ms default is therefore below the default no-output window.Tests:
node --test bin/opencode-route-proxy.test.mjs(35 passed).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.