Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughSession creation now prepares history seeds before spawning when history chunks are present. The output plane adopts prepared seeds, and the session pipeline creates and cleans up startup components. Startup ingress can discard queued work and close reply delivery. Tests cover replay equivalence, ownership, construction failures, cancellation, and session-creation behavior. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No issue requiring a fix before merge was identified; normal checks remain appropriate. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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
Restoring a large terminal history can briefly freeze typing in other terminals. Replay now gives pending input a turn while keeping the restored history ahead of the new shell prompt.
What Changed
Prepare the live terminal emulator with the existing bounded replay writer before spawning the restored child, then transfer it into the synchronous session constructor. The existing creation claim remains held throughout replay. Cancellation, shutdown, failed spawn and failed construction release prepared state; failed unattached construction discards startup buffers without emitting output.
Why
The constructor previously replayed every history chunk synchronously after spawn, blocking the daemon and its other PTYs. Preparing before spawn preserves history-before-prompt ordering and avoids buffering a running child during a long replay. This reuses the existing replay budget rather than adding another parser or changing history limits. Startup gates now share the existing pipeline builder; color-query answering moves into its existing reply owner to keep both modules within the line limit.
In the actual history-reader, seed-transfer and terminal-host creation pipeline on macOS, a 25 MiB seed reduced the replay event-loop pause from 367 ms to 1.5 ms and an independent native PTY's input response from 367 ms to 1.5 ms. Replay elapsed time remained about 366 ms. A 1 MiB seed reduced input delay from 18 ms to 2.0 ms. Snapshots matched in both workloads.
Linked Issue
Performance audit; no existing issue linked.
Visual Proof
N/A — terminal content and prompt ordering are preserved; this changes daemon scheduling and resource ownership.
Testing
19 new cases cover Unicode/escape boundaries, input modes, prompt ordering, ordinary creation, same-ID claims, cancellation, shutdown and failure cleanup. 554 broader tests and 166 final ingress/session tests passed, with two intentional skips in the broader run. An independent frozen-source comparison matched 108 seeds; the original host path fails the yielding regression. Node typecheck, native static rules and changed-file quality checks passed.
Measurements use real timers and an independent background native PTY on macOS, one warmup and four measured trials per workload. The restored child uses a fixture handle; RPC, Windows, Linux and a live SSH connection were not exercised locally. No wire fields change; the same execution-host daemon path applies to remote and folder workspaces. The complete large restore still includes an unchanged approximately 33 ms checkpoint-reading pause. This does not establish the cause of the reported ordinary Codex typing pauses.
AI Disclosure
Review
Self-reviewed cancellation, exclusive creation, emulator transfer, synchronous prompt delivery and cleanup ordering.
Agent skill upstream boundary
Notes
Native child termination policy and normal ingress teardown remain as before.
Checklist