Describe the bug
ClawPanel automatically rewrites agents.defaults.model.fallbacks to include all non-primary models whenever the models config is saved.
This makes it impossible to keep a short/manual fallback list.
As more models are added, the fallback chain becomes very long, which can cause frequent stalls / hangs during failover attempts.
What I expected
I expect one of these behaviors:
fallbacks should be user-editable and preserved as-is
- or ClawPanel should only initialize fallbacks once when empty
- but it should not overwrite the user's fallback list on every save
What actually happens
Whenever I add/edit/delete models or change the primary model, ClawPanel saves config and rewrites:
agents.defaults.model.fallbacks
agents.defaults.models
So the result becomes:
primary = selected primary model
fallbacks = all other configured models
This creates a very long fallback list automatically.
Source evidence
In src/pages/models.js:
function applyDefaultModel(state) {
ensureValidPrimary(state)
const primary = getCurrentPrimary(state.config)
const allModels = collectAllModels(state.config)
const fallbacks = allModels.filter(m => m.full !== primary).map(m => m.full)
const defaults = state.config.agents.defaults
defaults.model.primary = primary
defaults.model.fallbacks = fallbacks
const modelsMap = {}
modelsMap[primary] = {}
for (const fb of fallbacks) modelsMap[fb] = {}
defaults.models = modelsMap
}
And this is invoked before save in auto-save flow.
So the current behavior is not accidental — it is hardcoded.
Why this is a problem
For users with many configured models:
- fallback chains become huge
- failover becomes noisy and inefficient
- config gets rewritten against user intent
- the UI effectively does not support "minimal fallback"
- in practice this can contribute to freezes / stalls
Suggested fix
Possible fixes:
- Do not overwrite
defaults.model.fallbacks if it already exists
- Add explicit UI for editing fallback list
- Only auto-generate fallback list when the field is missing/empty
- Do not force-rebuild
agents.defaults.models on every save
At minimum, ClawPanel should respect the user's existing fallback config.
Environment
- Windows
- ClawPanel managing OpenClaw config
- Multiple providers/models configured
- Problem reproducible whenever models page triggers save
Describe the bug
ClawPanel automatically rewrites
agents.defaults.model.fallbacksto include all non-primary models whenever the models config is saved.This makes it impossible to keep a short/manual fallback list.
As more models are added, the fallback chain becomes very long, which can cause frequent stalls / hangs during failover attempts.
What I expected
I expect one of these behaviors:
fallbacksshould be user-editable and preserved as-isWhat actually happens
Whenever I add/edit/delete models or change the primary model, ClawPanel saves config and rewrites:
agents.defaults.model.fallbacksagents.defaults.modelsSo the result becomes:
primary = selected primary modelfallbacks = all other configured modelsThis creates a very long fallback list automatically.
Source evidence
In
src/pages/models.js:And this is invoked before save in auto-save flow.
So the current behavior is not accidental — it is hardcoded.
Why this is a problem
For users with many configured models:
Suggested fix
Possible fixes:
defaults.model.fallbacksif it already existsagents.defaults.modelson every saveAt minimum, ClawPanel should respect the user's existing fallback config.
Environment