#14550: fix(ui): save button dead after model change on single-agent setups (#13338)
app: web-ui
stale
size: S
Cluster:
UI Enhancements and Fixes
## Summary
Save button doesn't enable when you change the model or fallbacks on the Dashboard's Agents → Overview page. The handler bails early if the agent isn't in `agents.list`, which is the default for single-agent setups.
Added `ensureAgentListEntry()` that auto-creates a minimal `{ id: agentId }` entry in `agents.list` before the model update runs, so `updateConfigFormValue` succeeds and the form gets marked dirty.
Closes #13338
lobster-biscuit
## Repro Steps
1. Fresh install with default config (no `agents.list` in config)
2. Open Dashboard → Agents → main → Overview
3. Change Primary model dropdown to any other model
4. Save button stays disabled — no save call is made
## Root Cause
`onModelChange` in `ui/src/ui/app-render.ts` reads `configValue.agents?.list` from the config form. Single-agent setups don't populate that array (model lives in `agents.defaults.model`), so `Array.isArray(list)` returns false and the handler returns early. `configFormDirty` never flips, Save stays disabled. Same pattern in `onModelFallbacksChange`.
## Changes
- Before: changing model/fallbacks for agents not in `agents.list` does nothing; Save button stays disabled
- After: `ensureAgentListEntry()` creates the list entry on demand, `updateConfigFormValue` goes through, Save enables
## Note on env vars (also mentioned in #13338)
The original issue also mentions env vars can't be edited via Dashboard. I checked the code — env vars editing goes through the generic config form path (`onFormPatch` → `updateConfigFormValue` on the `env` key), not through the `agents.list` lookup. So it's a different code path and not affected by this fix. That part may need a separate investigation or may already be resolved in a newer version.
## Tests
- `ui/src/ui/app-render.ensure-agent-list.node.test.ts` — 5 tests covering null config, missing agents.list, missing agent entry, existing entry, and agents object without list array
- `pnpm build` and `pnpm check` pass
- All UI node tests (4 files, 40 tests) pass
Most Similar PRs
#20968: fix(ui): enable save button when editing default agent models
by Gitjay11 · 2026-02-19
76.4%
#15142: fix(ui): fallbacks input always empty even when config has models (...
by yinghaosang · 2026-02-13
72.3%
#23285: fix(dashboard): use config.patch for agent edits to prevent agent l...
by stakeswky · 2026-02-22
70.4%
#11806: fix(ui): agent model dropdown not reflecting actual primary model
by arturhoo · 2026-02-08
67.8%
#21735: fix(hooks): pass configured model to slug generator (#21650)
by lailoo · 2026-02-20
64.2%
#9080: Fix: Use configured model for memory file slug generation
by vishaltandale00 · 2026-02-04
63.5%
#11562: Fix #10883: Enforce subagent model configuration
by divol89 · 2026-02-08
63.0%
#22064: fix(failover): bypass models allowlist for configured fallback models
by winston-bepresent · 2026-02-20
63.0%
#21791: feat(TUI): show main agent model in status footer
by chansuke · 2026-02-20
63.0%
#11474: fix(cron): respect subagents.model in isolated cron sessions
by AnonO6 · 2026-02-07
62.8%