fix(server): opt the compact route out of the request idle timeout - #3744
fix(server): opt the compact route out of the request idle timeout#3744mashfromband wants to merge 1 commit into
Conversation
`/v1/responses/compact` buffers the whole upstream turn before it answers,
so the server-level `idleTimeout` (255 s) closes the client connection under
a long remote compact even though the upstream is still working; the client
then sees a truncated body ("error decoding response body" in Codex). The
other buffered data-plane routes already call
`disableResponsesRequestTimeout(req, requestServer)`; the compact route now
does the same, and a source contract test pins the call inside that branch.
Claude-Session: https://claude.ai/code/session_01VcTuv1wGXdywDr8xeQftdP
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
3/4 boxes ticked. The PR is more than 10 commits behind |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe ChangesCompact response timeout handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Compact responses can now complete long buffered upstream work without the server idle timeout truncating the response. No current merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
리뷰 · 우선순위 72 / 80이 PR은 Codex가 부르는 원격 컴팩트 경로 왜 컴팩트만 특히 위험한가. 고치는 내용은 아주 작습니다. 컴팩트 분기에서 origin 게이트를 통과한 직후 우선순위 72인 이유다. 원격 컴팩트는 Codex 실제 사용 경로이고, HEAD에 이미 있는 형제 라우트 패턴과 한 줄로 정렬하는 독립 버그픽스라 머지 비용이 거의 없습니다. release-244 로드맵(다음 task-input 020 등)과도 충돌하지 않습니다. 참고로 열려 있는 라인 1755 근처 (PR diff 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Carry the progress portion of lidge-jun#3736 and adapt lidge-jun#3744 to release listener idle protection only after a complete valid request body. Preserve the 300-second default and existing encrypted output. Local validation deferred to the final hosted CI by maintainer instruction. Co-authored-by: mashfromband <matsumoto.yukuhashi@gmail.com> Co-authored-by: Hylouis233 <88263959+Hylouis233@users.noreply.github.com>
Delivered — superseded by merged work
Verified in
devat5759d9ea2f1e7281cdc01eb9628f2e0a123fb59c: #3792 (823ffeb771).Original contribution: fix(server): opt the compact route out of the request idle timeout, by @mashfromband.
Accepted compact-request lifetime, with complete-body admission and bounded response-body inactivity.
The original PR is closed as superseded; its contribution remains credited in the landed history.
Attribution strengthened by #3811, merged as
cf9f662190c4c6770697c45c870941509cc98f9c. See CREDITS.md for the source-to-landing attribution record.Summary
/v1/responses/compactcollects the whole upstream compaction before it sends the first byte, so nothing keeps the client connection alive while a long remote compact is in flight. The server-levelidleTimeout(255 s) then closes the socket and the client receives a truncated body (Codex reportsstream disconnected before completion: ... error decoding response bodyfromError running remote compact task)./v1/images/*,/v1/alpha/search,/v1/messages,/v1/chat/completions,/v1/live) already opt out withdisableResponsesRequestTimeout(req, requestServer). This PR makes the compact route do the same, right after admission and the origin gate.devwithout the fix, passes with it).Reproduced locally with a fake upstream that stays silent for >255 s on the compact request: before the change the client saw a cut body at ~255 s, after it the compaction completed. The GoDD-AO proxy in front of this gateway has carried the same one-line change as a local patch since 2.43.0; this upstreams it.
Verification
bun test tests/server/server-auth.test.ts -t "compact route opts out"— 1 pass with the fix; the same test fails ondevwith the fix stashed.bun test tests/server/server-auth.test.ts— 107 pass, 0 fail.bun x tsc --noEmit— clean.bun scripts/privacy-scan.ts— passed.Checklist
https://claude.ai/code/session_01VcTuv1wGXdywDr8xeQftdP
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Tests