Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. from source inspection. Current main’s local ConfigStore.save path falls back to a direct config write after saveToGateway throws, and #64973/#74890 provide matching stale config.set and gateway.mode clobber symptoms. Next step before merge Security Review detailsBest possible solution: Land this focused guard after normal maintainer review and CI, then track the broader config.patch and structured-error-code migration separately. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Current main’s local ConfigStore.save path falls back to a direct config write after saveToGateway throws, and #64973/#74890 provide matching stale config.set and gateway.mode clobber symptoms. Is this the best way to solve the issue? Yes for the scoped fix. The latest PR blocks the high-risk fallback path, rejects destructive direct snapshots before replacement, preserves private permissions for rejected artifacts, and leaves the broader config.patch migration as follow-up work. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ae87f7800b2a. |
8ed0981 to
f9cf803
Compare
…th-guard # Conflicts: # apps/macos/Sources/OpenClaw/ConfigStore.swift # apps/macos/Sources/OpenClaw/OpenClawConfigFile.swift
|
Thanks for the focused fix here. I landed the same guard behavior adapted onto current That replacement preserves gateway auth/mode, rejects destructive fallback snapshots before local replacement, and keeps rejected payloads as private audit artifacts. Closing this PR as superseded by the merged replacement. |
Summary
Protect the macOS config save path from accidentally clobbering persisted Gateway auth/mode when a Gateway config write is rejected as stale/invalid/auth-related.
This is a focused guard for the App + Dashboard coexistence failure mode: a rejected Gateway write should not silently fall back to a direct full-file write that drops
gateway.authorgateway.mode.Changes
ConfigStore.save(_:)from falling back to direct local writes after stale/invalid/auth-like Gateway save failures.OpenClawConfigFile.saveDict(_:):gateway.authwhen a generic direct write omits itgateway.moderemoval and large suspicious size drops.rejected.<timestamp>and audit the rejectionBoolso high-risk call sites can detect rejectionAppState.syncGatewayConfigNow()logs and stops on rejected writesDebugSettings.saveSessionStorePath()surfaces a save errorScope / non-scope
config.patch; that remains follow-up work.Validation
Local validation run from
apps/macos:swift test --filter ConfigStoreTests --filter OpenClawConfigFileTests --filter AppStateRemoteConfigTestsResult:
Also run:
Result: no errors.
Note: the local pre-commit hook could not complete on this host because
swiftlintis not installed on PATH; the focused Swift tests above andgit diff --checkwere run manually.