#21884: feat(models): auth improvements — status command, heuristics, multi-account login
cli
commands
size: M
Cluster:
Model Authentication Enhancements
## Summary
Three improvements to the models/auth workflow:
### 1. `openclaw models auth status` command
New subcommand to show authentication status for all configured providers at a glance.
### 2. Prefer auth heuristics over registry availability
Model listing now uses auth heuristics to determine provider availability, providing better accuracy for custom providers that may not be in the model registry.
### 3. `--add` flag for multi-account login
`openclaw models auth login --add` now supports adding additional accounts to a provider without replacing the existing one.
## Changes
- `src/commands/models/auth.ts` — multi-account `--add` flag handler
- `src/cli/models-cli.ts` — CLI registration for `--add` flag and `auth status`
- `src/commands/models/auth-status.ts` — new auth status command
- `src/commands/models/list.registry.ts` — auth heuristics preference
## Testing
- Build passes (`pnpm build`)
- Manual testing of all three features
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added three auth workflow improvements: `auth status` command for viewing provider accounts, `--add` flag for multi-account login, and auth heuristics preference for model listing.
### Key Changes
- **`auth status` command** shows authentication status, token expiry, and usage quotas for configured providers
- **`--add` flag** enables adding multiple accounts to a provider without replacing existing ones (profile IDs auto-incremented on collision)
- **Auth heuristics** now preferred over registry availability for model listing accuracy
### Issues Found
- **Critical:** PKCE implementation in `openclaw-codex-auth` is broken—challenge should be SHA256 of verifier, not independent random bytes (security vulnerability)
- **Bug:** Date comparison in `formatResetTime` only checks day-of-month, breaking across month boundaries
- **Note:** PR includes unrelated files (SOUL.md, USER.md, memory-hybrid-bridge extension, memory_builder_prompt.txt) not mentioned in description
<h3>Confidence Score: 2/5</h3>
- Contains critical OAuth security vulnerability and date comparison bug that must be fixed before merge
- Core auth logic (`--add` flag, status command) appears sound, but `openclaw-codex-auth` PKCE implementation breaks OAuth2 spec (challenge must be SHA256 of verifier). Additionally, date comparison bug will cause incorrect "resets today" detection across month boundaries. PR also includes many unrelated files not mentioned in description.
- extensions/openclaw-codex-auth/index.ts (critical PKCE bug), src/commands/models/auth-status.ts (date comparison bug)
<sub>Last reviewed commit: 210b1fa</sub>
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12059: feat(agents): Add Azure AI Foundry credential support
by lisanyambere · 2026-02-08
80.9%
#9163: Fix: Save Anthropic setup token to config file
by vishaltandale00 · 2026-02-04
78.6%
#13079: feat: Add OpenAI-compatible API option to CLI for self-hosted models
by MikeWang0316tw · 2026-02-10
78.2%
#15756: [Security]: strip provider apiKey from models.json before prompt se...
by SecBear · 2026-02-13
78.0%
#16766: fix(model): apply provider baseUrl/headers override to registry-fou...
by dzianisv · 2026-02-15
76.8%
#9739: #9291 fix(models): preserve existing models in models.json when mer...
by ximzzzzz · 2026-02-05
76.6%
#21216: feat(models): add apiKeyHelper for dynamic API key resolution
by chrisvanbuskirk · 2026-02-19
76.4%
#3909: fix(auth): refresh all OAuth profiles per provider
by Daviey · 2026-01-29
76.3%
#17531: fix(auth): sync Codex CLI credentials into auth profile store and c...
by sauerdaniel · 2026-02-15
76.2%
#10367: CLI/Ops: resilient browser fill + failover hardening + operations t...
by cluster2600 · 2026-02-06
76.0%