-
-
Notifications
You must be signed in to change notification settings - Fork 69.3k
Feature: Trigger model fallback on context length exceeded #9986
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
When the primary model's context limit is exceeded, OpenClaw currently freezes/errors instead of falling back to a configured fallback model.
The agents.defaults.model.fallbacks config exists, but fallback only triggers on API errors (529 overloaded, timeouts, etc.) — not on context overflow.
Use Case
- Primary:
anthropic/claude-opus-4-5(200k context) - Fallback:
moonshot/kimi-k2.5(256k context)
When a conversation exceeds 200k tokens, I'd expect it to automatically try Kimi (which has more headroom) instead of failing.
Expected Behavior
- Detect context would exceed primary model's limit
- Check if any fallback model has sufficient context
- Automatically route to fallback with enough headroom
- Log the fallback event
Current Behavior
Session freezes or errors when context exceeds limit. Fallback is never attempted.
Environment
- OpenClaw: 2026.2.3-1
- Primary: anthropic/claude-opus-4-5
- Fallback: moonshot/kimi-k2.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.