Treat bare provider keys as default during logout, remove both bare and legacy :default keys, and validate profile selection against discovered profiles. Update auth tests to match bare-key storage semantics and relax memory leak test runtime to avoid CI/local timeout flakes.
For models without explicit authProfile:
- use bare provider key when present
- use :default when present
- otherwise choose first available provider profile (sorted)
Also reflect inferred profile in TUI status when model has no explicit profile.
In Ctrl+P -> Switch Model -> Connect a provider, prompt for profile name
before auth method handling and store API credentials under provider:profile
(default maps to bare provider key).
- Parse auth keys by last colon to avoid malformed profile extraction
- Treat bare provider keys as default profile in logout flow
- Remove both bare and :default keys when logging out default profile
- Validate --profile against discovered profiles
fix(tui): only list switch-model profiles present in auth state
Ensure profile variants appear even when direct auth profile discovery is unavailable by combining profile sources from auth keys, configured agents, current model, recents, and favorites.
Expand Switch Model entries by configured auth profiles per provider and preserve authProfile in recent/favorites selection keys so profile-specific model picks remain distinct.
Use mergeDeep(provider.options, model.options) in resolveSDK so per-request model options
(including profile-specific apiKey injected at runtime) override provider-level defaults.
This prevents provider.key from overriding the auth key selected for the active profile.
SessionPrompt.PromptInput now accepts model.authProfile so TUI/API payloads
keep profile selection instead of dropping it during validation. This allows
profile-specific auth keys to be used end-to-end.
debug(auth): increase key preview length in auth log
Propagate authProfile from user messages into resolved models, inject profile-specific
api keys into runtime model options in LLM streaming, and include authProfile in
Provider.getLanguage cache keys to prevent cross-agent credential leakage.
When no profile is provided, normalizeKey now returns the base providerID
without appending ':default'. This ensures backward compatibility - existing
auth.json entries with bare provider keys work correctly.
When looking up auth credentials:
- If profile key exists (e.g., 'minimax-coding-plan:personal'), use it
- If profile key doesn't exist but base provider does (e.g., 'minimax-coding-plan'), use that as fallback
This fixes the issue where build mode (no profile) wouldn't work when only 'minimax-coding-plan:personal' existed in auth.json.
Also removes normalizeKey usage from Auth.get - the fallback logic is now inline and clearer.
providers.ts:
- Use lastIndexOf + slice instead of split(':') for profile parsing
provider.ts:
- Extract base provider ID from composite auth keys (e.g., 'minimax-coding-plan:personal' → 'minimax-coding-plan')
- This fixes the issue where providers weren't recognized when using profile-based auth keys
- message-v2.ts: add authProfile to User.model schema
- prompt.ts: copy authProfile from model to userMsg.model
- lllm.ts: build auth key with profile when calling Auth.get()
- acp/types.ts: add authProfile to ACPSessionState.model
- acp/agent.ts: propagate authProfile in setModel call
This fixes the bug where embedded profiles (e.g., 'minimax-coding-plan:personal')
were lost when creating user messages and never reached Auth.get().
- currentProviderLabel now shows profile suffix when active
- parsed() now returns profile from model state
- isModelValid accepts authProfile optional field
- model.set includes authProfile when updating
- agent model change effect includes authProfile
- parseModel extracts authProfile from providerID if contains ':'
- Profile embedded in model string has highest priority
- Precedence: embedded > config authProfile > env var > default
- Auth.get supports direct lookup of provider:profile keys
- Agent.Info model supports optional authProfile field