Repository navigation
fix(runtime): GC expired proven-absent leaf PTY verdicts - #12810
Conversation
Sweep TTL-expired provenAbsentLeafPtyVerdicts on consult and insert so dead leaf ids do not retain Map entries for the process lifetime. Preserves the 15s no-reprobe cache for still-fresh verdicts. Fixes stablyai#12660
📝 WalkthroughWalkthroughThe runtime now prunes expired proven-absent PTY verdicts during liveness checks. It prunes entries before PTY consultation and before recording a new absence verdict. The pruning helper clears all entries for non-positive TTL values and removes entries whose age meets or exceeds the TTL. Tests cover expired entries, fresh entries, empty maps, and non-positive TTL values. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the change, rationale, linked issue, implementation scope, and validation results. However, it does not follow the repository template: required sections such as What Changed, Why, Visual Proof or an explicit N/A explanation, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist are missing. Resolution Update the description to include all template sections. Add an explicit Visual Proof section with N/A and a reason if no visual or interaction change exists. Include the required testing checkboxes, AI disclosure, review and boundary confirmations, notes about compatibility and performance, and the checklist items.
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 |
…f-12810 # Conflicts: # src/main/runtime/orca-runtime.ts
ELI5
Orca was keeping expired notes about missing terminals forever. This clears old notes during normal activity while preserving fresh checks and the existing rules for remote terminals.
Details
Long-lived runtimes kept a controller-proven PTY absence timestamp forever when that PTY ID was never consulted again. Cleanup now removes expired timestamps during other PTY consultations and when delayed absence probes finish.
The existing 15-second per-ID expiry, fresh-verdict reuse, live-provider override, concurrent probe coalescing, and unverifiable/error behavior remain intact. No fresh verdict is evicted. Whole-cache sweeps run at most once per existing TTL during activity, with clock-rollback recovery, so typing does not walk the map on each keystroke. Expired untouched entries can remain until the next due sweep; there is no idle timer.
The contributor's expiry helper is retained and wired into the current extracted runtime module. Original commits are preserved. This takes the expiry-only approach for #12660; the overlapping capacity eviction in #13146 is outside this change.
Validation against main
fa3d29fa11e3, withORCA_BACKGROUND_LAUNCH=1:Local validation ran on macOS; live remote and other-OS runs are left to CI.
Fixes #12660.