Repository navigation
fix(setup): preserve config edits made during provider preparation - #144568
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 9:47 PM ET / September 11, 2026, 01:47 UTC. ClawSweeper reviewWhat this changesGateway provider preparation and CLI login share a config writer that preserves unrelated concurrent edits and explains when credentials were saved but settings could not be applied. Merge readiness✅ Ready for maintainer review This PR addresses a remaining Gateway setup defect that the related merged auth fixes do not cover. Source review found no blocking correctness or security defect, and the reported live observations support the intended behavior. Priority: P2 Review scores
Verification
How this fits togetherProvider setup collects credentials and connection settings through Gateway wizard requests or CLI login. The config writer combines those settings with current authored configuration before publishing the result. flowchart TD
A[Gateway setup or CLI login] --> B[Provider preparation]
B --> C[Save credentials]
B --> D[Compute settings changes]
E[Current authored configuration] --> F[Validate and check conflicts]
D --> F
C --> F
F --> G[Commit through existing config owner]
F --> H[Report settings failure and saved credentials]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +54, Tests +227. Total +281 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep provider-specific replay in one shared writer while the existing config, credential, cancellation, and plugin-install owners retain their commit responsibilities. Do we have a high-confidence way to reproduce the issue? Yes: start Gateway provider preparation, edit an unrelated setting while input is pending, then complete it. Pinned main still enforces the earlier snapshot; the contributor reports reproducing this flow, while this review verified it from source. Is this the best way to solve the issue? Yes: sharing the established CLI replay policy fixes the Gateway failure without weakening the config owner's final conflict checks or changing credential activation policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1c1f85474f5b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Proof: Gateway provider preparation completes after an unrelated concurrent config edit. A real config write failure reports that credentials were saved.
Validated with real Gateway calls in isolated state, independent behavior checks, 45 Gateway setup tests, 55 CLI auth tests, and focused lint. Automated checks passed on attempt 2. The first attempt hit a Matrix import-hook timeout; the failed jobs passed on a fresh runner with no source or timeout changes. No failing-check exception was used. |
…penclaw#144568) ## What Problem This Solves Fixes an issue where users preparing a provider through Gateway setup received a raw config-changed error after saving credentials if another config edit occurred during login. The unrelated edit survived, but the provider settings were not applied and the error did not explain that the credential was already saved. ## Why This Change Was Made CLI login and Gateway preparation now share one config writer. It applies only the provider's changes to the latest authored config, merges model rows by ID, rejects conflicting or invalid edits, and uses the existing saved-credential/settings-failure error. Pending plugin-install records remain with their existing commit owner. The setup path no longer binds publication to the snapshot taken before login. Strict snapshot checks remain for migration promotion and verified setup operations that require them. Credential persistence, cancellation, and default-model policy retain their existing owners. ## User Impact Unrelated edits made while provider setup waits for input survive, and setup can complete. If settings cannot be applied, setup explains that credentials were saved and retains the config owner's recovery guidance. ## Evidence - Reproduced on main `c073aed1cfd1ae78c62b1920e76456b595e26950` through the shipped Gateway client: start preparation, edit an unrelated setting while the provider key prompt waits, then complete. Before: raw config-changed error with credential saved. After: setup completes with the edit and credential retained. - Real config-directory permission failure: before, config-only error despite a saved credential; after, explicit saved-credential/settings-failure message. Used isolated state and synthetic credentials. - 45 targeted Gateway setup tests and 55 CLI auth tests pass. The three original new regressions fail on main. Added protection for a config that becomes invalid during login. - Focused lint, formatting, line-count and assertion checks pass. Full type checks run in GitHub CI. Related: openclaw#144181, openclaw#144436. No changes to the credential replacement paths under openclaw#144524. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes an issue where users preparing a provider through Gateway setup received a raw config-changed error after saving credentials if another config edit occurred during login. The unrelated edit survived, but the provider settings were not applied and the error did not explain that the credential was already saved.
Why This Change Was Made
CLI login and Gateway preparation now share one config writer. It applies only the provider's changes to the latest authored config, merges model rows by ID, rejects conflicting or invalid edits, and uses the existing saved-credential/settings-failure error. Pending plugin-install records remain with their existing commit owner.
The setup path no longer binds publication to the snapshot taken before login. Strict snapshot checks remain for migration promotion and verified setup operations that require them. Credential persistence, cancellation, and default-model policy retain their existing owners.
User Impact
Unrelated edits made while provider setup waits for input survive, and setup can complete. If settings cannot be applied, setup explains that credentials were saved and retains the config owner's recovery guidance.
Evidence
a321595f496e5a95d2bd0ffe81f7a080b4fcdfc8through the shipped Gateway client: start preparation, edit an unrelated setting while the provider key prompt waits, then complete. Before: raw config-changed error with credential saved. After: setup completes with the edit and credential retained.Related: #144181, #144436. No changes to the credential replacement paths under #144524.