Repository navigation
perf(google): avoid rescanning fragmented SSE records - #7766
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Fragment accounting and validation src/adapters/google.ts, tests/adapters/google/google-stream-fragmentation.test.ts, structure/providers/google.md, structure/transports/byte-accounting.md, scripts/test-layout/layout-adapters.json, tests/fixtures/test-layout-expected.json |
parseStream reserves byte budget for each decoded fragment before appending it. It skips splitting retained text when the fragment has no newline and measures the residual suffix after complete lines are consumed. Tests cover large fragmented records, split UTF-8, EOF budget boundaries, overflow, cancellation, and early-iteration cleanup. The documentation and test layout describe and register this coverage. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Merge Risk: 
Minimal · up to 44f1b
-
No actionable issue is established for this change; it is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
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. |
|
Maintainer integration into
|
Summary
Fragmented Google SSE input repeatedly measures and splits the entire unfinished line, making small chunks of a large record increasingly expensive. Measure only newly decoded text and split the retained line only when a fragment adds a newline.
Replacement storage remains reserved before concatenation, old/new overlap stays charged, and decoder EOF output uses the same accounting path. Add operation-count, split UTF-8, EOF, overflow, and reader-cleanup regressions, and update the owning contracts and test registry.
Verification
44f1b1db0a7733aeca1850d695c3305d7542efeecompleted the four Linux CI shards, Catalog async contracts, and required gates before submission. Job logs confirm all 10 newgoogle-stream-fragmentation.test.tscases ran and passed.Checklist
Co-authored-by: Epinephrine [email protected]
Summary by CodeRabbit