Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.59 KB

File metadata and controls

64 lines (48 loc) · 2.59 KB

omp-auto-resume

License: MIT Runtime: Bun omp extension

An Oh My Pi extension that automatically resumes a session after a confirmed Claude (Anthropic) usage-limit block, instead of leaving it sitting on an error until you come back and type continue yourself.

The problem

omp's built-in retry system deliberately gives up rather than sleep through a multi-hour Anthropic rate-limit window (retry.maxDelayMs, default 5 minutes) — that's intentional, to avoid a session hanging silently for hours. But it also means a long-running or overnight session just stops and waits for you, even though the fix (wait for the reset, say "continue") is mechanical.

What this does

Listens for omp's auto_retry_end failure event, fetches a fresh usage report to confirm it's a real Anthropic 5h/7d window exhaustion (not some other unrelated error), waits until that window's reset time, and sends a continue message to pick the session back up — all inside the omp process, no terminal scraping or tmux wrapping required.

Reactive only: it never guesses off the usage status-line percentage, only off a live failed-retry signal confirmed against a fresh report. See docs/superpowers/specs/2026-07-16-omp-auto-resume-design.md for the full design rationale.

You'll get a notification (in-app + best-effort desktop notify-send) both when the block is detected and when the session resumes. It never resumes more than once per distinct block window, and never resumes over live work if you're back at the keyboard when the timer fires.

Install

This is a multi-file extension (index.ts + predicate.ts), so install it as a directory, not a single symlinked file:

git clone https://github.com/AnsCodeLab/omp-auto-resume
ln -s "$(pwd)/omp-auto-resume" ~/.omp/agent/extensions/auto-resume

omp's extension discovery loads index.ts from a subdirectory automatically (one level, no manifest required) — predicate.ts is a regular imported module, not a second top-level extension.

Scope (v1)

  • Anthropic provider only.
  • 5h and 7d usage windows only.
  • One resume per distinct block episode (a window rolling over to a new reset time is a new, eligible episode).
  • In-memory state only — a pending resume is lost if the omp process exits before the timer fires (same limitation as claude-auto-retry's tmux-pane approach for the plain claude CLI).

License

MIT