Swarm DM with interrupt delivery does not preempt a worker deep in tool loops
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Observed (2026-08-14, live swarm run)
A spawned worker spent 2.5h / ~377k tokens on a bounded ~2-minute verification probe, continuously inventing new probe variants (tool call after tool call, 'thinking' state between them).
The coordinator sent a wrap-up directive via swarm dm with delivery: "interrupt":
Coordinator directive: WRAP UP NOW ... file complete_node with an honest partial artifact ...
The worker never acted on it. It kept running tool loops for another ~35 minutes until the coordinator called swarm stop on it. A 15-minute await_members in between timed out with the worker still running.
Expected
delivery: interrupt should inject the message at the next safe point (injection point between tool calls), so a worker that is continuously executing tools still sees the directive within a tool-call boundary or two — that is exactly the situation interrupts exist for.
Suspicion
Interrupt injection may only be evaluated at turn boundaries (after a full assistant turn completes), not between tool calls within a turn. A worker in a long agentic turn that chains dozens of tool calls never reaches that boundary, so the interrupt starves. If that is the design, worker runaways cannot be steered at all — only killed — which loses the partial work the directive was trying to salvage.
Repro sketch
- Spawn a headless worker with a prompt that produces a long tool-heavy turn (e.g. 'probe these 50 URLs one at a time and reason between each').
- While it is mid-turn, coordinator sends
swarm dmwithdelivery: interrupttelling it to stop and report. - Observe whether the directive is processed before the turn's natural end.
Environment
jcode v0.75.x-dev lineage (master fork dwillitzer/jcode @ ca1f2ef51), macOS, cliproxy openai-compatible provider, headless spawned worker, deep-mode task graph run.
Contributor guide
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 with the swarm dm interrupt-delivery path and the injection point between tool calls, then reproduce the long tool-heavy worker turn described in the issue. Done means an interrupt directive is processed within a tool-call boundary or two, before the worker's natural turn ends, while await_members observes the worker responding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100