Repository navigation
fix(typescript): isolate VM work from Tokio workers - #2954
Conversation
There was a problem hiding this comment.
Isolation direction looks right (admission + spawn_blocking), but resumed steps lose their deadline — see inline.
Comments outside the diff
knowledge/operations/everruns-1351-typescript-admission.md line 1: [P2] New OKF concept knowledge/operations/everruns-1351-typescript-admission.md has no update to knowledge/operations/index.md in the changed files. Per knowledge/knowledge-contract.md, every index.md must enumerate its own directory, so the drift/OKF check will likely flag the new concept. Fix: list the new doc in operations/index.md (and keep the See also backlink).
crates/bashkit/src/builtins/typescript.rs line 2095: [P2] vm_admission_caps_active_threads_and_times_out_queued_steps depends on tight wall-clock margins (100ms deadline vs 200ms VM sleep + 150ms grace, asserting maximum()==2 && active()==0). Under a loaded CI worker the started==2/active==0 assertions can flake. Consider wider margins or polling active()==0 with a timeout instead of a single sleep.
| fn on_vm_stack<T>(meter: &crate::vm_meter::VmMeter, step: impl FnOnce() -> T) -> Option<T> { | ||
| let _window = crate::vm_meter::VmWindow::enter(meter); | ||
| Some(step()) | ||
| async fn run_vm_step<T>( |
There was a problem hiding this comment.
[P1] Resumed steps bypass the admission/execution deadline: run_vm_step_with_admission(step, None) waits on the semaphore with no timeout and task.awaits with no timeout, so a multi-step program can wait past max_duration/overall deadline and hang if permits are held by abandoned timed-out threads. The previous code passed deadline for every step. Fix: pass the remaining vm_clock.deadline() (e.g. Some(deadline)) for steps 2..n, same as the first step.
|
Review verdict: sound isolation direction (semaphore admission + Findings:
Context read: PR diff (not truncated), |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 73dff08 | Commit Preview URL Branch Preview URL |
Nov 19 2026, 01:14 AM |
Summary
Validation
cargo fmt --checkcargo clippy -p bashkit --lib --features typescript -- -D warningscargo bench -p bashkit --bench parallel_execution -- --quickjust pre-prcompleted formatting, clippy, and 2,697/2,701 full tests. Four pre-existing child-process cleanup tests that require observingESRCHfail identically on this host, including when retried serially outside the sandbox; all changed TypeScript and documentation tests pass. GitHub CI is required to be green before merge.Linear:
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.