Repository navigation
Release completed provider write payloads - #26208
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change releases completed write data while preserving close and cancellation behavior, and the relay test retains its intended lease and region-correction checks. No identified issue blocks merging, subject to normal hosted checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve 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 |
ELI5
An idle agent session can retain its last sent prompt. Completed and closed provider writers now release the stale reference immediately.
What Changed
Clear the saved drain-listener cleanup function after invoking it on completion and close. The current shared provider write queue owns that function; the protocol-specific wrapper remains a thin subclass. This preserves the newer active-write cancellation handling.
Why
Removing the stale reference at the existing completion boundary releases the payload without changing outgoing messages, queue ordering, backpressure or admission limits. It needs no new cache, timeout or prompt-size limit.
In seven alternating Node 24.20.0 process pairs, four actual ACP session runtimes sent generated 2 MiB text prompts and remained alive after successful replies. Median idle heap growth after GC fell from 8,669,808 to 275,376 bytes. All four removed drain closures remained alive before and none remained alive after. Every initialize, new-session, and prompt frame had identical byte lengths and SHA-256 hashes; native write buffers and drain listener counts were already zero in both versions. Four 256 KiB prompts also released about 1 MiB of excess heap. These are supported generated large-text fixtures, not captured ordinary prompts or evidence of improved typing latency.
Linked Issue
N/A — maintainer performance audit.
Visual Proof
N/A — completed write data ownership changes; no visual or interaction change.
Testing
The branch includes the test-only fixture correction in #26397: region-change scenarios now advance beyond the initial connection grace period, renew their existing control lease and refresh heartbeats. The corrected transport suites pass 16 tests, and 23 source-owned cutover checks preserve the minimum-age guard. No runtime rule is relaxed.
Review
Clear the stale closure before admitting another write. Preserve active abort handlers, rejection order and the terminal error fence against late callbacks. Independent review found no negative user-facing trade-off.
Agent skill upstream boundary
Notes
No wire format, execution-host routing, path or agent-status changes. Folder-workspace and remote callers retain the same lifecycle.
Checklist