Repository navigation
perf: avoid copying Codex output between saved checkpoints - #26199
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe coalescer now tracks retained text length and supports an optional predicate that can skip snapshot emission. Codex uses this predicate to apply its checkpoint growth threshold. Tests cover Unicode and truncation length tracking, below-threshold checkpoints, retries, and flush behavior. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue is identified before merge. Complete the remaining CI checks, including packaging and additional platforms. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ 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 |
ELI5
Large Codex command output uses less CPU between saved checkpoints. Chat content and publication timing stay the same.
What Changed
Codex already saves streamed text only after enough new text arrives, but it assembled the entire prefix before deciding to skip a checkpoint. It now checks the same threshold against the retained JavaScript string length before assembling that prefix. Final flushes and refused writes still retain and publish all owed text.
The shared coalescer's optional gate accepts a skipped snapshot; refusal and retry still come from its existing sink callback. Claude and the other shared consumer keep the default behavior.
Why
Reuse the existing checkpoint threshold to remove repeated copying without changing streaming intervals, text limits, or journal rows. A new debounce or cache would change timing or add ownership state.
A supported generated 16MiB command stream, delivered in 256 manual 60ms windows through the complete translator and real SQLite journal, reduced timer prefix assembly from 256 joins / 2.156 billion characters to 34 joins / 138 million characters. Seven alternating uninstrumented trials reduced median total synchronous work during those windows from 189.77ms to 83.46ms. Final flush time is excluded from this measurement. The largest single window remained near 9ms, and small controls were mixed. These results establish reduced copying and CPU work; they do not measure heap bytes or desktop/phone typing latency.
Linked Issue
N/A — maintainer performance audit.
Visual Proof
N/A — text, rows, publication cadence, and user interaction remain unchanged.
Testing
Temporary frozen-source comparison passed 274 exact control cases and 13 complete real-journal cases. These compare row content, publication order, admission results, snapshots, and timer schedule/cancel/fire traces, including Unicode and truncation, rejected writes/retries, capacity eviction, changed attribution, completion and patch flushes, and unchanged Claude/timeline consumers. Independent journal epoch UUIDs alone are normalized.
Every measured trial verifies final output byte length and SHA256, plus identical journal row and publication counts. Fixture is generated supported output, not a captured private CLI transcript. Local host: macOS/Node. This is platform-independent string accounting with no path, subprocess, execution-host, or wire changes; remote clients receive the same content at the same cadence.
Persistent regression tests fail on the old implementation (two failures, one unchanged retry control passing) and all 161 tests in 16 focused suites pass with the change. Coverage includes the shared coalescer, Codex translator streams, Claude checkpoints, and all provider timeline assembler suites.
pnpm tc:node, ordinary/native/anti-slop lint, formatting, max-lines ratchet, and changed-code quality against baseline4077fb4a8de8pass. The combined audit branch also passes 3,369 tests in 323 Codex/journal/timeline/coalescer/Claude files, the full project typecheck, and changed-code quality (77 files, zero new findings). Selected CI checks also pass, including all five Node 24 shards, cross-version wire compatibility, relay integration, Linux persistence, and Linux/Windows packaging. The Windows profile-state stall test passed on a job retry after its first run timed out; no unrelated source or test changes were made.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Folder workspaces and SSH/paired execution retain their existing routing. No changes to process status, remote capabilities, client schemas, or payload limits.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)