VM dispose stalls after guest network use
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.6k
- Forks
- 251
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 34
Description
Disposing a VM after guest code used the network is slow, and very slow when a response body was left unread.
Repro
const vm = await AgentOs.create({ permissions: { network: "allow" } });
await vm.javascript.evaluate(`(await fetch("https://example.com")).status`);
await vm.dispose(); // ~100 s
Actual
- Dispose logs
ERR_AGENTOS_VM_TEARDOWN_DEADLINE: … active_tasks=1 … deadline_ms=5000and then takes about 100 s to return. - Reading the body first (
await response.text()) brings the whole call back to ~400 ms, but any guest network use still adds roughly the 5 s teardown deadline.
Expected
Dispose closes guest sockets and returns within the configured shutdown deadline. Untrusted code should not be able to hold a VM open by leaving a connection unread.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the AgentOs.create, vm.javascript.evaluate, and vm.dispose sequence in the issue, comparing unread and fully read response bodies. Trace the VM disposal and guest-network teardown entry points to identify why active_tasks remains; done means guest sockets close and dispose returns within the configured shutdown deadline, including for unread responses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust, wasm
- Domain
- backend, networking, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100