Repository navigation
fix(macos): recover node startup after legacy identity recreation - #120610
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 11:41 AM ET / 15:41 UTC. ClawSweeper reviewWhat this changesThis PR makes valid SQLite device identities win over recreated retired JSON files and launches debug macOS node workers through the selected checkout’s freshness-aware runner. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer merge handling: the focused repair correctly restores canonical SQLite identity precedence and debug worker startup, with no actionable patch defect found. Priority: P1 Review scores
Verification
How this fits togetherThe macOS app starts a native Node worker that reads device identity state from the shared SQLite database. Retired JSON identity files are migration inputs handled by Doctor, while the launch resolver selects the worker command and working directory. flowchart LR
A[macOS app] --> B[Node startup coordinator]
B --> C[Identity store]
C --> D{Canonical SQLite row exists?}
D -->|Yes| E[Use canonical identity]
D -->|No| F[Doctor-owned legacy migration]
B --> G[Debug worker launch resolver]
G --> H[Node worker process]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +32, Other +106. Total +143 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Merge the canonical-state-first repair after the normal exact-head maintainer gate, preserving Doctor as the sole owner of divergent retired-file handling. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: a valid canonical row plus a divergent recreated retired identity file reaches the legacy-first gate on current main and fails before this repair. Is this the best way to solve the issue? Yes. Making the canonical SQLite store authoritative at both runtime owners, while retaining Doctor as the only legacy-file migration owner, is the narrowest durable fix. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7ecdef6e2ed4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head 35baff2:
|
|
Merged via squash.
|
…way readiness (#126748) * fix(state): keep divergent retired device identity from blocking gateway readiness Classify a divergent retired identity file as a startup notice when the canonical SQLite identity remains valid and authoritative under #120610. Preserve the fatal warning for missing or invalid canonical state, so the readiness gate itself remains unchanged. Fixes #117270. Release note: prevents gateway crash loops caused by a recreated retired device identity JSON after a verified SQLite migration. * fix(state): preserve device identity migration receipt integrity Reuse canonical SQLite identity validation and retain incomplete receipts for preserved divergent claims. Co-authored-by: Vito Cappello <[email protected]> --------- Co-authored-by: VACInc <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…way readiness (openclaw#126748) * fix(state): keep divergent retired device identity from blocking gateway readiness Classify a divergent retired identity file as a startup notice when the canonical SQLite identity remains valid and authoritative under openclaw#120610. Preserve the fatal warning for missing or invalid canonical state, so the readiness gate itself remains unchanged. Fixes openclaw#117270. Release note: prevents gateway crash loops caused by a recreated retired device identity JSON after a verified SQLite migration. * fix(state): preserve device identity migration receipt integrity Reuse canonical SQLite identity validation and retain incomplete receipts for preserved divergent claims. Co-authored-by: Vito Cappello <[email protected]> --------- Co-authored-by: VACInc <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Closes #120608
What Problem This Solves
Fixes an issue where macOS app users could lose native node startup after an older app build recreated retired device identity JSON files alongside valid canonical SQLite identities. The app would repeatedly report
Could not access the persisted device identity, leaving node capabilities such as camera control unavailable.Why This Change Was Made
Canonical SQLite rows now win before retired identity files are examined in both the native and TypeScript identity paths. Divergent retired files remain untouched for explicit Doctor handling, while missing canonical rows still use the existing migration flow.
Debug Mac node workers now launch the selected checkout through the freshness-aware
scripts/run-node.mjsrunner with an explicit checkout working directory, rather than invoking a bare launcher against potentially partial shareddist/output. Installed/release CLI behavior is unchanged.AI-assisted implementation and review; the behavior and ownership boundaries were independently verified against copied state.
User Impact
Affected macOS nodes recover their existing canonical identity and can connect again without rotating keys, deleting retired files, or changing the SQLite schema. Developers also get deterministic worker startup from the intended checkout and its validated build artifacts.
Evidence
Before the repair, a throwaway Swift probe against a copied state directory returned:
After the repair, the same copied state returned:
Focused validation:
DeviceIdentityStoreTests: 37 passedsrc/infra/device-identity.test.ts: 20 passedCommandResolverTests: 26 passedMacNodeHostWorkerTests: 15 passedpnpm lint:swiftunder the Xcode toolchain: 0 violationsgit diff --check origin/main...HEAD: passedThe remote fast-CI backend was unavailable during local preflight, so trusted-source validation followed the documented local fallback. Hosted exact-head CI remains the landing gate.