fix-spawn-failures

Fix: spawn_failures circuit breaker has no CLI reset and permanently blocks dispatch

Metadata

Statusdone
Assignedagent-791
Modelpi:zai:glm-5.2
Created2026-07-25T14:34:58.650430898+00:00
Started2026-07-25T19:40:03.307428730+00:00
Completed2026-07-25T20:24:55.628849450+00:00
Tagsbug, dispatcher, lifecycle, cli
Tokens0 in / 0 out

Description

Objective

The per-task spawn_failures counter, once it hits the threshold (5), blocks all dispatch for that task PERMANENTLY until manually cleared — and NO wg CLI clears it. wg retry / wg reset only touch status/failure_reason/retry_count, not spawn_failures. Today the only remedy is a surgical graph.jsonl edit (pause dispatcher, back up the graph, set spawn_failures: 0 on the one line, resume) — which is what unblocked resolve-prophage-source after the registry/key fix landed.

Root cause

The spawn circuit breaker (spawn_failures on the task; threshold dispatcher.max_spawn_failures = 5) trips and stays tripped. There is no CLI surface to reset it, and it does not self-heal (no time-based decay, no auto-clear on a successful spawn or on wg retry).

Work

  1. Make wg retry <task> (or a dedicated wg reset-spawn-breaker <task>) clear spawn_failures so dispatch resumes WITHOUT a graph edit.
  2. Make the breaker self-healing: decay after a cooldown, and/or auto-clear on the next successful spawn, so a transient burst (e.g. caused by the layer-1 registry failure) does not permanently brick a task.
  3. The breaker must be per-task and must never block the WHOLE dispatcher (only the affected task).
  4. Surface a tripped breaker clearly in wg show/wg status (not just a silent "spawned=0" in the daemon log).

Validation

  • Force 5 spawn failures on a task; wg retry <task> clears spawn_failures and the worker dispatches immediately, with no graph.jsonl edit.
  • A tripped breaker self-heals (cooldown decay or clear-on-success).
  • A tripped breaker on one task never blocks dispatch of other tasks.
  • A tripped breaker is visible in wg show/wg status.

Reference

Root-cause layer 3 from the resolve-prophage-source incident (spawn_failures:5 stuck; required graph.jsonl surgery).

Depends on

Required by

Log