Repository navigation
fix(mac): prevent app auth from blocking node-host startup - #115533
Merged
Merged
Conversation
Missing-file tolerance now applies only to the first observation; a disappearance after the auth file was observed fails the migration so the claimed identity survives for retry instead of committing without its credentials.
steipete
marked this pull request as ready for review
July 29, 2026 04:02
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
Merged via squash.
|
vincentkoc
added a commit
that referenced
this pull request
Jul 29, 2026
…ifecycle-hooks * origin/main: fix(mattermost): key private channels as group on outbound routing (#96645) fix(ci): grant Telegram QA runtime scratch access (#115659) fix(telegram): stop retrying blocked recipients (#115640) fix(tts): persist generated speech in media store (#115647) fix(gateway): preserve complete streamed chat completions (#115652) fix(mac): prevent app auth from blocking node-host startup (#115533) fix(heartbeat): keep message-tool final replies private (#115629) fix(gateway): drain root work continuations before direct-stop process exit (#105848) fix(ollama): keep active streams within their idle timeout (#115648) fix(delivery): keep session keys out of inferred message targets (#115657) fix(ci): type code mode matrix catch callback (#115674) refactor(agents): centralize bundled CLI backend auth policy (#115633) refactor: remove 3,527 lines of runtime and test duplication (#115626) [AI] fix(doctor): stop repeated bundledDiscovery migration noise on beta (#115208) # Conflicts: # scripts/code-mode-model-matrix.ts
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
…115533) * fix(mac): move device auth tokens to shared SQLite state * fix(mac): fail identity migration when source auth vanishes mid-read Missing-file tolerance now applies only to the first observation; a disappearance after the auth file was observed fails the migration so the claimed identity survives for retry instead of committing without its credentials. * fix(ios): validate auth scope UTF-8 encoding * fix(ios): isolate SQLite auth profiles * chore(ios): refresh native source inventory * fix(mac): keep device auth in the shared token table * test(mac): pin shared-key token cache semantics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where Apple apps could permanently block a macOS node host from restarting after device-auth tokens were migrated to SQLite on the Node side.
PR #112663 made Node refuse startup whenever
identity/device-auth.jsonremained, but the shared Swift store still rewrote that retired file. In the live 2026-07-28 incident, Doctor imported and deleted the file, the app recreated it on launch, and the next node-host restart failed again. This loop was reproduced twice on real hardware (megaclawandminiclaw).Why This Change Was Made
The shared Swift
DeviceAuthStorenow uses the exact Node-owneddevice_auth_tokenstable instate/openclaw.sqlite, preserving the existing opaque role-key encoding and public Swift API. Every operation opens the shared database, validates or bootstraps the canonical table, and performs its row mutation in an immediate transaction. Legacy profile files are read through a hard 4 MiB bound, imported with preserve-canonical semantics, retired before the requested operation can commit, and quarantined only after successfully read content proves invalid.Cross-container identity relocation now imports destination legacy auth first and then source auth into SQLite, preserving canonical destination rows while never deleting or rewriting the source auth file. The old JSON writer, destination-file publisher, and
renamex_npauth path are removed.Compatibility
This is an additive canonical table and does not bump
user_version. Version-zero native bootstrap databases create it lazily. Versioned Node-owned databases must already contain it and fail closed otherwise, requiring a newer CLI plus Doctor. An older native build may reject a version-zero database containing the new table; native downgrades are not a shipped compatibility contract.Unlike the retired file store, the
profileparameter no longer selects a separate token-file namespace. It selects device identity resolution only; token rows are shared in the canonical table and keyed by(device_id, role), so the same row is visible for a supplied device ID regardless of profile. Per-profile identities remain disjoint because they resolve to distinct device IDs, and Node reads the same table by the same key.The production diff is +248 net lines. That growth is the explicit SQLite statement layer plus bounded/retry-safe legacy I/O and non-creating identity lookup; it replaces the steady-state JSON write path and cross-container file publication with one canonical storage path.
User Impact
Mac, iOS, watch, and share-extension callers keep the same
DeviceAuthStoreAPI, but no Apple client writesdevice-auth.json,node-device-auth.json, orshare-device-auth.jsonanymore. Node hosts can restart without the app recreating the retired-file startup gate. Existing tokens migrate once, gateway-scoped metadata is reconstructed from the stored key, profile clears affect only the current profile identity, and temporary filesystem failures remain retryable instead of losing credentials.Evidence
Focused Swift package proof:
Structured Codex autoreview on the final uncommitted bundle:
Live incident evidence: the retired file was observed being recreated after Doctor cleanup and the resulting node-host restart failure was reproduced twice on
megaclawandminiclawon 2026-07-28.