fix: release bounded response resources - #5835
Conversation
|
@lidge-jun @Wibias please prioritize review of this bounded-response retention fix. It closes a reproduced request-lifetime memory amplification path and an abandoned Devin response-body path; focused tests and privacy scan are green under the documented host limits. @codex review |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughBounded response readers now use interruptible waits for deadlines and aborts. Devin Cloud chat starts cancellation of non-OK response bodies before throwing the existing status-bearing ChangesBounded Response Ownership
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The bounded readers preserve the interruption outcome across reads, and Devin error handling starts best-effort body cancellation while retaining the status error. No concrete source-level merge risk is established; standard exact-head checks should still complete. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changed readers retain their byte limits, deadlines, and cancellation behavior, while rejected Devin responses are now cancelled without delaying the original HTTP error. No security regression was established, but production caller coverage and comparison with the target branch remain incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 |
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. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
리뷰 · 우선순위 64 / 80응답이 잘게 나뉘어 들어올 때, 이미 버퍼에 넣은 조각이 요청이 끝날 때까지 메모리에 남던 길을 끊는 PR이에요. 예전에는 조각이 하나 올 때마다, 그 읽기를 요청이 살아있는 동안 계속 기다리는 중단·시간제한과 같이 기다렸어요. 오래 사는 쪽에 붙은 연결이, 이미 다 읽은 조각(빈 조각 포함)을 요청이 끝날 때까지 붙잡았어요. 이제는 기다리는 자리가 하나예요. 시간 초과와 중단은 지금 그 자리만 끝내요. 읽기가 끝난 조각은 다음 조각을 받는 동안 치워질 수 있어요. 바이트 상한, 받은 양이 딱 맞으면 본문을 취소하지 않는 것, 시간 초과, 중단 이유, 읽기가 늦게 실패하는 것, 취소가 실패하거나 끝나지 않아도 원래 오류를 지키는 것은 테스트로 고정해 두었어요. Devin 채팅이 HTTP 오류이면, 아무도 안 읽을 본문을 한 번 취소해요. 취소가 끝나길 기다리지 않고 원래 상태 코드 오류를 던져요. 취소가 거절되거나, 그 자리에서 예외가 나거나, 영원히 안 끝나도 상태 코드는 그대로예요. 본문이 없는 403도 상태 코드만 알려요. 기준 브랜치는 tests/server/bounded-body.test.ts tests/server/bounded-body.test.ts PR 본문 - 결정 기록을 ADR-5830이라고 적었어요. 실제 파일은 메인테이너의 판단이 필요한 지점
실패한 Devin 응답은 취소를 시작만 해요. 오류는 바로 던지고, 취소가 끝날 때까지 기다리지 않아요. 전송 쪽이 취소를 미루면 그 본문은 그동안 남아요. 작성자는 빨리 던지는 쪽을 골랐고 ADR에 적었어요. 그 선택을 유지할지만 보면 돼요. 이 커밋의 저장소 타입체크는 끝까지 안 돌렸어요. 작성자는 호스트를 오래 잡지 않으려고 멈췄다고 했어요. 합치기 전에 CI 타입체크를 볼지 정하면 돼요. 너의 추천 고친 방향은 맞아요. 조각마다 오래 사는 프로미스에 연결을 달던 구조를, 지금 읽는 칸 하나로 바꾼 것이 이 누수의 수정이에요. 닫을 중복 PR은 없어요. PR 본문의 ADR-5830만 ADR-0101로 고치세요. 두 눈금 테스트는 남기되, 실패하면 실제 이 댓글은 grok-bot이 작성했습니다 |
|
Closing and reopening only to rebuild CI against dev after #5847 fixed the shared protocol-direct-encoders-chat failure; no change to this PR. |
|
Maintainer integration by the owner (MAINTAINERS.md 2026-09-06 rule), release round 2.66.0. Exact-head evidence for |
Summary
GetChatMessagebodies once without waiting or replacing the original status errorVerification
bun test tests/server/bounded-body.test.ts tests/providers/devin-hardening.test.ts— 106 passed, 0 failedbun run privacy:scan— passedCPUQuota=75%,MemoryHigh=1G,MemoryMax=1536M,MemorySwapMax=0,TasksMax=64,IOWeight=20GOMAXPROCS=2; it remained within the cap but was stopped rather than occupying the host for several more minutes, so exact-head CI must supply that gateRisk and compatibility
Checklist
Summary by CodeRabbit