Skip to content

Wisp chain fragility: single crash permanently breaks self-pouring patrol loop #140

@alexsiri7

Description

@alexsiri7

Problem

The refinery patrol (and similar wisp-based loops) relies on each iteration pouring the next wisp before burning the current one. If the session crashes at the wrong moment — after starting work but before pouring the next wisp — the entire loop breaks permanently.

Failure scenario

  1. Refinery is processing work in wisp N
  2. Quota exhaustion (or any crash) kills the session
  3. Wisp N is still assigned but the session is dead
  4. No new wisp N+1 was poured
  5. When the session eventually restarts, it may find the old wisp but the chain is interrupted
  6. If the old wisp gets cleaned up (burn, timeout), there's no next iteration

Impact

The gascity refinery patrol loop broke during quota exhaustion. 6 work beads sat unprocessed for hours until manual intervention poured a fresh wisp.

Suggested fixes

Option A: External wisp watchdog

An order (not wisp-driven) that periodically checks: "does each always-on agent have an active wisp assigned?" If not, pour one. This is the NDI (nondeterministic idempotence) approach — multiple observers, convergent.

Option B: Reconciler-aware wisp management

The reconciler could detect named sessions with no active wisp and trigger formula dispatch.

Option C: Crash-safe pour-before-burn

Make the formula runner pour the next wisp at the START of each iteration (not the end), so crashes after pour are safe. The old wisp stays around as a no-op if the new one takes over.

Option A is most aligned with the existing architecture (NDI, no framework intelligence).

Metadata

Metadata

Assignees

Labels

kind/bugBroken behaviorpriority/p1High — core workflow brokenstatus/acceptedConfirmed and on our radar

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions