Skip to content

fix(agents): the parent's stop cancels a child at once, and JS hosts get AbortSignal-typed contexts - #39

Merged
spacedevin merged 1 commit into
mainfrom
fix/agents-parent-stop
Oct 14, 2026
Merged

spacedevin merged 1 commit into
mainfrom
fix/agents-parent-stop

Conversation

@spacedevin

Copy link
Copy Markdown
Member

Found moving PopCraft onto 2.0.0.

  1. Parent Stop. The Tish runtime checked the parent's signal only between a child's rounds, so a child in a long model call or tool kept running after the parent turn stopped. SpawnRequest.signal is documented to stop the child. Now a platform signal (an AbortSignal) also stops the child's control at once, which cancels its in-flight request; native hosts keep the between-round check. New test: a child whose model call never returns stops when the parent signal aborts (it stayed running before).
  2. Types. In this package each child's ctx.signal is an AbortSignal (the default createSignal uses AbortController), but AgentHost typed it as { aborted }, so hosts had to cast it to pass it to fetch. createAgentRuntime now takes a JsAgentHost whose callbacks receive JsChildRunContext with signal: AbortSignal.

101 tests pass; examples type-check; VM, JS and native smoke runs agree.

…get AbortSignal-typed contexts

The Tish runtime checked the parent's signal only between a child's rounds, so a child in a long model call or tool
kept going after the parent turn's Stop (SpawnRequest.signal says it stops the child). A platform signal now also
stops the child's control at once — cancelling its request in flight — while a native host keeps the between-round
check. createAgentRuntime here takes a JsAgentHost whose callbacks see ctx.signal as the AbortSignal it is.
@spacedevin
spacedevin merged commit a3ca026 into main Oct 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant