Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

SpinLock — Agent Failure Series #12

The loop your STOP button cannot end.

Live demo: https://rlasaf12.github.io/spinlock/

Part of the Agent Failure Series — interactive simulators showing how AI agents fail in production.


What Is SpinLock?

SpinLock demonstrates the infinite loop failure mode — when an AI agent enters a cycle it cannot detect or exit. You watch the cost counter climb. You hit STOP. Nothing happens. The agent reasons "task not complete" and continues.

This happens in production. Real developers have reported $200 bills from 2-minute tasks and API budgets drained in under 10 minutes.


Four Scenarios

# Name Failure Pattern
The Write Loop Path correction alternates between two invalid paths — same error forever
Agent Ping-Pong Orchestrator ↔ sub-agent cycle with no TTL or depth limit
Retry Death Spiral 429 rate-limit + no exponential backoff = immediate retry storm
Completion Blindness Task done after iteration 1 — stale verifier returns False 47 more times

What You Can Do

  • SEND STOP SIGNAL — watch the agent ignore it
  • INJECT CIRCUIT BREAKER — terminates the loop, shows the 3-line fix
  • Switch scenarios via the tab bar at the top

The Fix (Every Scenario)

# 1. Duplicate detection
if error_hash in seen_errors: raise CircuitBreaker("duplicate error")

# 2. Iteration limit  
if iterations > MAX_ITERATIONS: raise CircuitBreaker("limit reached")

# 3. Exponential backoff
wait = min(2**attempt + jitter(), 60); time.sleep(wait)

Real Pain Signals


Built By

Harel Asaf — AI Operator. Finds where organizations bleed time. Builds the systems that fix it.

Built with: pure HTML/CSS/JS — no framework, no dependencies, no build step.

About

SpinLock — Agent Failure Series #12. Interactive simulator showing the infinite loop failure mode AI agents fall into in production.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages