#15142: fix(ui): fallbacks input always empty even when config has models (#15131)
app: web-ui
stale
size: S
#### Summary
The Fallbacks input field on the Agent Overview page is always empty, even when `agents.defaults.model.fallbacks` has entries. The Primary Model label correctly shows `(+2 fallback)` but the input below it doesn't get populated.
Closes #15131
lobster-biscuit
#### Repro Steps
1. Set `agents.defaults.model.fallbacks` in `openclaw.json` with 2+ models
2. Open Control UI → Agents → Overview tab
3. The "Fallbacks (comma-separated)" input is empty despite the label showing the correct count
#### Root Cause
`renderAgentOverview` in `agents.ts` resolves fallback models from `config.entry?.model` only. Single-agent setups (and any agent without a per-agent model override) don't populate `config.entry.model`, so `resolveModelFallbacks` returns `null` and the input stays empty. The label works because `resolveModelLabel` already checks both entry and defaults.
#### Behavior Changes
- Before: Fallbacks input always empty when using global defaults
- After: Fallbacks input shows the configured fallback models from `agents.defaults.model.fallbacks`
#### Tests
- `agents-fallbacks.node.test.ts` — covers `resolveModelFallbacks` for undefined, string, object with fallbacks/fallback, missing fallbacks, and non-string filtering
- build, check pass
**Sign-Off**
- Models used: N/A
- Submitter effort: traced the mismatch between the label and input field, one-line fallback chain fix
- Agent notes: N/A
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR fixes the Agents → Overview “Fallbacks (comma-separated)” field not being pre-populated when fallback models are only configured via `agents.defaults.model.fallbacks`. It does this by falling back to `config.defaults?.model` when `config.entry?.model` doesn’t define fallbacks, and adds a Vitest unit test file covering `resolveModelFallbacks` behavior for several model shapes (string, object w/ `fallbacks` or `fallback`, missing, and mixed-type arrays).
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge after ensuring the new test actually runs in CI.
- The functional change is small and localized (fallback chain in `renderAgentOverview`) and matches existing UI behavior for labels. The main remaining concern is whether the newly-added `*.node.test.ts` file is picked up by the project’s Vitest include pattern; if it isn’t, the regression coverage claimed by the PR won’t exist.
- ui/src/ui/views/agents-fallbacks.node.test.ts (confirm Vitest includes this pattern or rename)
<sub>Last reviewed commit: 757c4cf</sub>
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#11349: fix(agents): do not filter fallback models by models allowlist
by liuxiaopai-ai · 2026-02-07
81.0%
#11806: fix(ui): agent model dropdown not reflecting actual primary model
by arturhoo · 2026-02-08
78.1%
#22064: fix(failover): bypass models allowlist for configured fallback models
by winston-bepresent · 2026-02-20
78.1%
#21963: fix(cli): models fallbacks add now includes primary model in allowlist
by ashiabbott · 2026-02-20
77.1%
#20968: fix(ui): enable save button when editing default agent models
by Gitjay11 · 2026-02-19
77.0%
#8390: feat: notify user when fallback model is used (#8182)
by Glucksberg · 2026-02-04
76.8%
#16838: fix: include configured fallbacks in model allowlist
by taw0002 · 2026-02-15
76.6%
#10178: fix: trigger fallback when model resolution fails with unknown model
by Yida-Dev · 2026-02-06
76.5%
#20275: fix(cli): include primary model in allowlist when adding fallbacks
by MFS-code · 2026-02-18
76.3%
#23816: fix(agents): model fallback skipped during session overrides and pr...
by ramezgaberiel · 2026-02-22
75.9%