-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Feature request: fallback model chain for compaction and LCM summaryModel #56781
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Problem
Compaction (
agents.defaults.compaction.model) and LCM (plugins.entries.lossless-claw.config.summaryModel) each accept a single model. If that model is rate-limited or unavailable, compaction fails silently — sessions grow unbounded until the primary model recovers.Agent chat has a proper fallback chain (
agents.defaults.model.fallbacks), but compaction and LCM do not.Proposed solution
Add an optional
fallbacksarray (same semantics asagents.defaults.model.fallbacks) to:agents.defaults.compaction.fallbacksplugins.entries.lossless-claw.config.summaryModelFallbacks(or similar)When the primary compaction/summary model fails with 429, 500, or timeout (same triggers as agent model failover), OpenClaw should try the next model in the fallback list before giving up.
Use case
Primary:
anthropic/claude-sonnet-4-6(flat-rate MAX plan — free)Fallback:
openrouter/anthropic/claude-3.5-haiku(metered — only used on failure)This lets users keep compaction on a free/cheap primary while having a paid safety net that only fires when needed.
Current workaround
None within OpenClaw. An external reverse proxy could implement the fallback, but that adds operational complexity and another failure point.
Environment
OpenClaw 2026.3.13 (61d171a), macOS arm64