Repository navigation
fix(macos): avoid Tailscale hydration config rewrites - #75982
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. The linked issue gives a concrete Settings > General mtime/diff path, and current main still shows General mounting Tailscale settings plus hydration/onChange/apply code that can persist Next step before merge Security Review detailsBest possible solution: Land the macOS-owned hydration no-op guard after maintainer review so #59545 closes through the merge, while leaving broader config mutation reports to their focused tracks. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue gives a concrete Settings > General mtime/diff path, and current main still shows General mounting Tailscale settings plus hydration/onChange/apply code that can persist Is this the best way to solve the issue? Yes. The snapshot/dirty-check is the narrowest maintainable fix I found: it keeps initial UI hydration read-only without changing global config save semantics or removing the intentional Tailscale auth mutation path. Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8731820ba276. |
8f6e9ca to
efa8366
Compare
|
Resolved the review point in
Verification rerun:
Duplicate sweep result:
Outcome: #59545 remains the canonical issue and this PR remains linked with |
|
@clawsweeper re-review CI follow-up pushed in Verification after the formatting fix:
|
|
🦞🦞 I asked ClawSweeper to review this item again. |
bbf427c to
aaf4db2
Compare
|
@clawsweeper re-review Rebased the branch onto current The PR diff remains scoped to:
Post-rebase verification:
|
|
🦞🦞 I asked ClawSweeper to review this item again. |
Summary
openclaw.json.gateway,gateway.auth,meta, orwizard.Fixes #59545
Root Cause
TailscaleIntegrationSection.loadConfig()hydrates SwiftUI@Statevalues, and the existing.onChangehandlers can scheduleapplySettings()during that initial state change. OncehasLoadedis true, the pending apply path rewrites the config even though the user has not edited settings, normalizing unrelated gateway/auth/meta fields through the save path.Fix
GatewayTailscaleSettingsSnapshotafter load, with password trimming normalized to match the save path.applySettingsthroughapplySettingsIfChanged; unchanged hydration state returns before validation, save, and status calls.TailscaleIntegrationSectionand the existingConfigStore.save(... allowGatewayAuthMutation: true)flow.Regression
The new test writes a config with
gateway.bind = "auto", token auth, and existingmeta/wizard, then simulates General/Tailscale hydration plus save-on-change. With the no-op guard removed, this test fails by rewritingbindtoloopback, dropping auth mode, and touchingmeta.lastTouchedAt; with the guard restored it passes.Verification
git diff --check origin/main...HEADswiftformat --lint apps/macos/Sources/OpenClaw/TailscaleIntegrationSection.swift --config .swiftformatswiftlint lint --config .swiftlint.yml apps/macos/Sources/OpenClaw/TailscaleIntegrationSection.swift apps/macos/Tests/OpenClawIPCTests/TailscaleIntegrationSectionTests.swiftpnpm exec oxfmt --check --threads=1 CHANGELOG.md apps/macos/Sources/OpenClaw/TailscaleIntegrationSection.swift apps/macos/Tests/OpenClawIPCTests/TailscaleIntegrationSectionTests.swiftswift test --package-path apps/macos --filter OpenClawIPCTests.TailscaleIntegrationSectionTestsswift test --package-path apps/macos --filter 'OpenClawIPCTests\.(TailscaleIntegrationSectionTests|SettingsViewSmokeTests|OpenClawConfigFileTests|ConfigStoreTests)'OPENCLAW_LOCAL_CHECK_MODE=throttled pnpm check:changedaaf4db2450:Workflow Sanity,OpenGrep — PR Diff, andCIsucceeded