#19994: fix(model-picker): filter models by auth when no allowlist configured [AI-assisted]
commands
size: S
Cluster:
Model Management Enhancements
## Summary
Fixes issue #4349: The TUI model picker was showing all 600+ models instead of only showing models from providers that the user has authenticated with.
## What & Why
When no explicit model allowlist is configured (`allowAny = true`), the model picker now filters the catalog to only show models from providers that have authentication configured. This significantly improves the UX for users who only have a few providers set up.
The default provider's models are always included in the filtered results to ensure users can still select the default model.
## Changes
- Added auth-based filtering in `promptDefaultModel()` when `allowAny` is true
- Filter keeps: (1) models from authed providers, (2) the default provider's models
- Reused `hasAuth` checker to avoid creating multiple instances
- Added `includeUnauthenticated` param to allow users to bypass the filter and see all models
- Added try/catch around auth check to handle failures gracefully
## Testing
- Lightly tested: Code compiles, logic follows existing patterns in the codebase
- Manual testing would be needed to verify the full UX flow
## AI-assisted
This PR was written with AI assistance (OpenClaw, minimax m2.5 model).
---
- [x] Mark as AI-assisted in the PR title or description
- [x] Note the degree of testing (lightly tested)
- [x] Confirm you understand what the code does
Most Similar PRs
#21882: feat(gateway): filter models.list by agents.defaults.models allowlist
by kckylechen1 · 2026-02-20
70.8%
#7570: fix: allow models from providers with auth profiles configured
by DonSqualo · 2026-02-03
69.9%
#8174: feat(wizard): strict model filtering for preferred providers
by gkamboj-bot · 2026-02-03
69.7%
#7020: feat: add search/filter to model selection in configure wizard
by GuoxiangZu · 2026-02-02
68.5%
#16388: Fix: Show model selector during onboarding for all auth choices
by saurav470 · 2026-02-14
68.3%
#6673: fix: preserve allowAny flag in createModelSelectionState for custom...
by tenor0 · 2026-02-01
68.2%
#14508: fix(models): allow forward-compat models in allowlist check
by jonisjongithub · 2026-02-12
68.1%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
67.7%
#20567: fix: validate model IDs against catalog before saving to config
by baja87 · 2026-02-19
66.3%
#6440: feat(ui): add model picker dialog with provider filtering
by igorls · 2026-02-01
66.2%