Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:23blocks OS Ai maestro Wake Chain Routing

From Leeroopedia
Knowledge Sources
Domains Agent_Messaging, Wake_Notification
Last Updated 2026-10-26 10:00 GMT

Overview

An ordered wake-notification chain that tries multiple delivery routes in preference order, stopping only at the first route that proves arrival.

Description

The wake chain is a fail-forward notification router. It tries each adapter in order (streaming session, Claude Code channel, tmux pane, inbox sweeper, doorbell) and stops at the first one that returns `confirmed` — a proven arrival. Adapters that return `sent` (sent but unconfirmed) or `deferred` (queued for idle) do not stop the chain: an unproven wake is worth nothing to an agent that is waiting, and a duplicate nudge is cheaper than a lost message.

A thrown adapter is recorded as `failed` and the chain continues — one broken route must never strand a message that another route could still carry. If no route confirms, the message is enqueued for retry on the agent's idle transition, with a backoff that gives up loudly rather than silently.

Usage

Use this principle when designing notification delivery where:

  • Multiple delivery routes exist with different reliability levels
  • Proven arrival (not just "sent") is the stopping condition
  • Unconfirmed delivery must be retried, not silently dropped

Theoretical Basis

The chain is a first-success-wins iterator with fail-forward semantics:

for adapter in adapters:
  try:
    outcome = adapter.deliver(ctx)
  catch:
    outcome = { status: 'failed' }
  if outcome.status == 'confirmed':
    return { confirmed: true, confirmedBy: adapter.name }
return { confirmed: false, deferred: anyDeferred, attempts }

Only `confirmed` stops the chain. `sent`, `deferred`, `unavailable`, and `failed` all continue. This is the dual of a circuit breaker: instead of stopping on first failure, it stops on first success and fails forward through failures.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment