Skip to main content
GitHub

Fallback Fixes

Use alternative models or strategies.

Fallback fixes provide alternative strategies when the primary fails.

Use Cases

  • Model unavailability
  • Cost optimization
  • Latency reduction
  • Graceful degradation

Configuration

Fallback fixes use a fallback_type and fallback_config structure:

{
  "fix_id": "fix-fallback-001",
  "fix_type": "fallback",
  "config": {
    "fallback_type": "model",
    "fallback_config": {
      "model": "gpt-4o-mini"
    }
  }
}

Config Keys

KeyTypeDescription
fallback_typestring"model" or "default"
fallback_configobjectType-specific fallback configuration

Fallback Types

Model Fallback

Switch to a different model when the primary fails:

{
  "fix_type": "fallback",
  "config": {
    "fallback_type": "model",
    "fallback_config": {
      "model": "gpt-4o-mini"
    }
  }
}

When triggered, the runtime sets params["model"] to the fallback model before retrying the call.

Default Response Fallback

Return a predetermined default response instead of retrying:

{
  "fix_type": "fallback",
  "config": {
    "fallback_type": "default",
    "fallback_config": {
      "response": "I'm unable to process this request right now. Please try again later."
    }
  }
}

Common Fixes

Model Timeout

Switch to a faster, smaller model:

{
  "fix_type": "fallback",
  "config": {
    "fallback_type": "model",
    "fallback_config": {
      "model": "gpt-4o-mini"
    }
  }
}

Graceful Degradation

Return a safe default when all else fails:

{
  "fix_type": "fallback",
  "config": {
    "fallback_type": "default",
    "fallback_config": {
      "response": "Service temporarily unavailable. Please try again."
    }
  }
}

Targeting

{
  "target": {
    "models": ["gpt-4o"],
    "agents": ["researcher"],
    "error_codes": ["TOOL.EXECUTION.TIMEOUT"]
  }
}

Next Steps