auto-resume

Self-healing OpenCode sessions —” automatic retries, model rotation on quota/outages, permission autopilot & walk-away task autonomy

Cross-platform (Node.js) TypeScript Developer Tools

auto-resume is an OpenCode plugin that makes your AI coding sessions resilient to interruptions.

Features

  • Automatic Retries —” Detects rate limits, quota exhaustion, network errors, and model outages; retries with exponential backoff
  • Model Rotation —” Seamlessly switches between models (GPT-4, Claude, etc.) when one hits limits
  • Permission Autopilot —” Handles permission prompts automatically for safe operations
  • Walk-Away Autonomy —” Long-running tasks continue unattended; recovers from crashes automatically

Installation

# Via OpenCode plugin system
opencode plugin install neohiro/auto-resume

How It Works

The plugin wraps OpenCode’s execution pipeline with a resilience layer:

  1. Error Classification —” Categorizes failures as retryable (rate limits, timeouts) vs. non-retryable (syntax errors, logic bugs)
  2. State Persistence —” Checkpoints conversation state every N turns to survive restarts
  3. Model Pool —” Maintains a prioritized list of fallback models with capability matching
  4. Permission Profiles —” Pre-approves safe operations (file reads, searches) while prompting for risky ones

Configuration

{
  "autoResume": {
    "maxRetries": 5,
    "baseDelayMs": 2000,
    "maxDelayMs": 60000,
    "modelPool": ["gpt-4o", "claude-3.5-sonnet", "gpt-4-turbo"],
    "permissionProfile": "balanced"
  }
}

Use Cases

  • Overnight refactoring —” Start a large refactor before bed, wake up to completed work
  • CI/CD pipelines —” Run OpenCode in automated pipelines without manual intervention
  • Unreliable networks —” Mobile/hotspot development where connections drop
  • Multi-model workflows —” Use best model per task, auto-fallback on limits

Requirements

  • OpenCode v0.8+
  • Node.js 18+
  • Valid API keys for at least one model in the pool

This tool is free and open source. Support the developer: