fix(models): keep auth login out of main config#88612
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 31, 2026, 10:07 AM ET / 14:07 UTC. Summary PR surface: Source +99, Tests +398, Docs +5. Total +502 across 14 files. Reproducibility: yes. Source inspection gives a high-confidence reproduction path: current Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this only after maintainer review confirms the auth/config boundary and the PR includes redacted real CLI/filesystem proof for fresh and upgrade-shaped login behavior. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence reproduction path: current Is this the best way to solve the issue? Mostly yes. Keeping ordinary login credentials in AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against ec8cb8bcbfae. Label changesLabel justifications:
Evidence reviewedPR surface: Source +99, Tests +398, Docs +5. Total +502 across 14 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 870be5b6d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const profile of profiles) { | ||
| next = applyAuthProfileConfig(next, { | ||
| profileId: profile.profileId, | ||
| provider: profile.credential.provider, | ||
| mode: credentialMode(profile.credential), | ||
| }); |
There was a problem hiding this comment.
Stop re-adding auth profiles during config-patch logins
When a provider returns any configPatch, this block still calls applyAuthProfileConfig for every login profile, so common SDK OAuth flows that include a model config patch (for example OpenAI Codex login via the standard auth-result helper) continue writing auth.profiles/auth.order into openclaw.json. In that scenario, models auth login --provider openai without --set-default still mutates the main config with auth login metadata even though the credential store is meant to own the login; apply the provider patch/default-model update without also re-adding auth profiles here.
Useful? React with 👍 / 👎.
870be5b to
66e7589
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60dbb79577
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(params.createFromOrder ?? []), | ||
| ...listProfilesForProvider(store, providerKey), |
There was a problem hiding this comment.
Preserve config-only order entries for scoped agents
When models auth login --agent ... runs for an agent whose existing config order includes a config-only profile (for example an aws-sdk auth profile with no persisted credential), this seeds the per-agent store order with that profile id. Non-default agent stores are later loaded through loadAuthProfileStoreForRuntime, which merges main+agent stores and mergeAuthProfileStores filters order entries to ids present in profiles, so the config-only fallback is dropped before resolveAuthProfileOrder can mark it eligible. The new login then shadows that configured fallback for scoped agents; preserve these ids through merge or avoid writing them into store order.
Useful? React with 👍 / 👎.
ca19a3f to
f89c66e
Compare
|
Verification before merge: Behavior addressed: models auth login now keeps login-created auth profiles in the auth store instead of rewriting normal config auth profile patches, while preserving configured provider/profile order constraints and legacy credential compatibility. Real environment tested: local macOS source checkout plus GitHub CI. Exact steps or command run after this patch:
Evidence after fix: focused auth/profile tests, production/test type gates, docs format check, diff whitespace checks, and autoreview all passed locally. GitHub CI run 26714511861 is clean for f89c66e; two unrelated gateway shards initially hit no-output timeouts, then passed on failed-job rerun. Observed result after fix: no accepted/actionable autoreview findings; required PR checks clean. What was not tested: live provider login against real external OpenAI/Gemini/Codex accounts was not run in this landing pass. |
Summary
Verification
Behavior addressed
models auth login now stores plain login credentials in the auth profile store and does not touch openclaw.json unless the provider returns a config patch or the user passes --set-default.
Real environment tested
Local OpenClaw checkout on macOS, Node repo test wrappers.
Exact steps or command run after this patch
The verification commands listed above were run after the final patch.
Evidence after fix
Focused tests cover plain login not calling updateConfig, config/profile and config/order shadowing cases, apiKey persisted type normalization, and store order creation preserving configured order tails.
Observed result after fix
All listed tests and checks passed, and autoreview reported no accepted/actionable findings.
What was not tested
No live provider OAuth flow was run.
Fixes #88565