Current status (2026-08-27)
Implemented and verified in c6a4e4a3513dfb2a05a13357c06f598ad9f1d6ce on codex/runtime-port, authored and committed by Chris Breuer without coauthors. Published, not merged into main; this issue remains open for integration tracking. The pending probe is promoted to tests/runtime/native-worker-heap-snapshot.test.mjs. See the checkpoint comment for complete verification and remaining boundaries (#465, #468, #481, #482).
Original reproduction before this checkpoint
Follow-up to #66, #461, and #465. The bounded worker-heap-snapshot-cancellation.pending.mjs probe queues a snapshot while its worker is blocked, terminates the worker, then checks promise settlement. Home leaves the promise pending until the explicit deadline. The linked JSWorker.cpp captures a raw pointer to a parent-owned Strong promise handle; queued task destruction drops that pointer without parent-thread cleanup.
Implement cancellation-aware ownership for the complete round trip. Settle or cancel requests on the parent thread, release the Strong handle there, and handle parent shutdown without cross-thread HandleSet mutation. General task deletion alone is insufficient. The probe permits either a resolved readable stream or ERR_WORKER_NOT_RUNNING rejection; it checks settlement, not snapshot payload correctness. Node can resolve despite termination. Consuming the stream during the race caused a Node 24.18.0 crash, so that crash is not a required behavior or a passing control.