Skip to content

queen(actors): a killed turn stops - AbortSignal into model and git calls, process groups killed whole #1713

Closed

Description

@gHashTag

Part of #1712 (item 2: turns that really stop).

Problem

A killed actor turn is only abandoned:

  • actorChild.stop and the turn timer end the pid, but nothing reaches the work. A killed review keeps its row and its z.ai key lane until it ends on its own, up to the 120 s model timeout (REVIEW_TIMEOUT_MS). Its restarted worker takes another row meanwhile, so during stalls more than REVIEWER_CONCURRENCY reviews run at once.
  • processWork kills with proc.kill(9), which reaches only the direct child. A shell's or a compiler's children survive the kill.
  • queen-actors-isolate.ts lines 6-10 say stop "really ends the work" for threads too. Measured on Bun 1.3.11, a terminated spinning worker kept counting.

What this adds (behind TRIOS_QUEEN_TURN_STOP=on, a pure fix where noted)

  • The rule is the card specs/queen/turn_stop.t27 (spec(queen): a killed actor turn stops - its abort, a grace, then its process group t27#8274), vendored as turn_stop.wasm + queen-turn-stop-card.gen.js.
  • ActorSpec.receive gets the turn's AbortSignal. When the pid dies (the turn timer or any exit), actors.t27 stop_signal X_SHUTDOWN aborts it. After TURN_STOP_GRACE_MS, the card's escalation kills the process group or records an abandon.
  • The reviewer's model call (defaultReviewerLlm) and its git and criterion commands (run, defaultExec) obey the signal. Shared checkout writes and finalizers run to their end (step_on_abort). A stopped review writes no verdict.
  • The reviewer's intake counts killed reviews that still hold a lane against the bound (in_flight).
  • Pure fix: process isolates lead their own process group and are killed as a group. The false comment is corrected.

Acceptance

  • A test where a turn ignores its signal and is escalated and killed.
  • A test where a process isolate spawns a grandchild and nothing survives.
  • A stalled-reviewer simulation that never exceeds the configured concurrency.
  • A before/after benchmark on the same seeded input: maximum concurrent reviews during stalls, time from kill to lane freed (target 5 s or less), and surviving processes (target 0). Posted on Queen moves to the actor model: the rule in every AGENTS.md, an MVP, a benchmark, then the swap t27#7851 and in the PR.
  • No new failure in the api suite.

Activity

  1. added 2 commits that reference this issue on Oct 9, 2026
    a43f079
    255a7c0
  2. gHashTag commented on Oct 10, 2026

    @gHashTag
    CollaboratorAuthor

    Shipped: #1720 merged into actors-next, which went into queen as 56c5df7 via #1730 (2026-10-10 13:38Z). Every new behaviour is behind a flag that is off. Closes fires only on the default branch main, so this is closed by hand. Ledger: #1729.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions