fix(streaming): bound translated SSE inspection - #1114
Conversation
|
✅ Deterministic PR hygiene checks passed. |
📝 WalkthroughWalkthroughThe translated SSE request-log tracker and heartbeat relay now reuse ChangesSSE inspection integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73706d3b2c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| inspector.finish(); | ||
| if (!terminalReported) reportTerminal("incomplete"); |
There was a problem hiding this comment.
Preserve terminals for oversized completed frames
When a translated stream's terminal frame itself exceeds the 4 MiB inspection cap (the bridge allows much larger SSE events, and response.completed carries the full output/compaction item), createSseInspector discards that frame and never calls reportTerminal; on clean EOF this branch then records "incomplete" even though the client already received a successful terminal event. This corrupts request-log/account outcome data for large but valid translated responses, so terminal reporting needs to come from the bridge side or from a bounded prefix detector before the frame is discarded.
Useful? React with 👍 / 👎.
|
Thank you for this — it is landing. I have picked your commit into the stacked campaign as #1133 (targeting Reusing the existing byte-bounded Verified on the stack head: I am leaving this PR open — it is yours to close or continue as you prefer. Closing it is not something I want to do on your behalf. |
Summary
Closes #1112
Verification
nice -n 10 taskset -c 0,1 bun test tests/sse-inspector-bounds.test.ts tests/passthrough-abort.test.ts— 37 pass, 0 failnice -n 10 taskset -c 0,1 bun run typecheck— passednice -n 10 taskset -c 0,1 bun run privacy:scan— passednice -n 10 taskset -c 0,1 bun run test— passed onef131787; the branch was then rebased ontoa5b37827, whose only intervening change was an issue-quality workflow permission test, and the focused tests plus typecheck were rerun after the rebaseChecklist
Summary by CodeRabbit