Files
codex/codex-rs/code-mode-runtime/src
jif d77ebc7223 Cancel code mode timer tasks when cleared or the cell finishes (#45399)
## Why

Each `setTimeout` spawned a sleeping thread that remained alive until its delay elapsed, even after `clearTimeout` or cell completion.

## What changed

Replace per-timer threads with Tokio sleep tasks held by `AbortOnDropHandle`, so removing a timeout or dropping the isolate cancels its task. Enter the caller's Tokio runtime on the code mode runtime thread to support scheduling these timers.

## Testing

Add a regression test using virtual time to verify that cleared timers release their tasks, an awaited timer completes, and cell completion cancels remaining timers without emitting their output.

GitOrigin-RevId: 59c7e57ed226cb32633e2d4c25b778cfab2af423
2026-09-14 09:29:51 +00:00
..