Repository navigation
fix: migrate client credentials automatically before startup - #178998
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. What this changesThis PR automatically prepares client credentials through Doctor before macOS app, Gateway, and node startup. Example: A macOS profile has pending credential migration after updating from 2026.10.5.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current startup failure; both prior findings are resolved, no actionable introduced defect was found, and exact-head CI remains pending. Priority: P0 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherStartup admission validates the selected configuration and database, delegates credential migration to Doctor’s existing maintenance owners, and then admits native, Gateway, and node credential consumers. flowchart TD
A[App Gateway or node startup] --> B[Configuration and state admission]
B --> C[Credential readiness]
C --> D[Doctor maintenance and backup]
D --> E[Existing migration owners]
E --> F[Local credential SQLite store]
F --> G[Credential consumers]
Technical reviewBest possible solution: Recover supported credential migrations inline during startup through Doctor while preserving keys, tokens, approval policy, and rollback bindings. Do we have a high-confidence way to reproduce the issue? Current-main readiness gates and the app’s terminal-repair alert establish the failure path; the PR also records a packaged baseline reproduction, but this read-only review ran no target code. Is this the best way to solve the issue? The smallest complete fix delegates startup repair to Doctor and updates receipt, promotion, and port consumers together so credential ownership stays consistent. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1892041df9f4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1040, Tests +2704, Docs +10, Other +37. Total +3791 across 62 files. Added test files: 6. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 21, 2026, 5:31 AM ET / 09:31 UTC (Revision 2). |
Baseline-Refresh: 713055cd239a7fa1866b9704cf7eb8d9392b0f64
Baseline-Refresh: a7bde44efc3c4776206898acad3fb1515c3149e7
Baseline-Refresh: 8aee9dfc97eaabc938c9d3a1e78347f1101ae34c
Baseline-Refresh: 3af9c2d6b0e680c91a3f223d74e1c3067cfd3556
|
Merged via squash auto-merge.
|
…w#178998) * fix: migrate client credentials automatically before startup * fix(credentials): preserve startup admission and bootstrap ownership * fix: preserve credential ownership across state migrations * test(credentials): type the retained socket fixture * test(state): use canonical PostgreSQL discovery fixtures * test(state): use canonical deferred profile migration fixture
Run normal startup credential custody admission in the existing credential worker before serving, and reuse the admitted receipt postimage instead of reading it again. Preserve migration-required handling, app custody, port rebinding, security checks, and once-per-process admission. The frozen workload removes 20 credential SQL statements and all 31 credential MAIN statements across boot/restart, with two additional worker requests. Warm SQL/request medians remain 45/11 and warm MAIN remains zero. Builds on #178998. Co-authored-by: Jason (Json) <[email protected]>
…aw#180154) Run normal startup credential custody admission in the existing credential worker before serving, and reuse the admitted receipt postimage instead of reading it again. Preserve migration-required handling, app custody, port rebinding, security checks, and once-per-process admission. The frozen workload removes 20 credential SQL statements and all 31 credential MAIN statements across boot/restart, with two additional worker requests. Warm SQL/request medians remain 45/11 and warm MAIN remains zero. Builds on openclaw#178998. Co-authored-by: Jason (Json) <[email protected]>
What Problem This Solves
Fixes Mac app, Gateway, and node startup requiring manual credential repair after an update leaves migration pending or the filesystem renumbers the same database.
User Impact
Supported upgrades migrate credentials and approvals automatically, preserving existing keys, pairing tokens, and policy without a Doctor command, prompt, or re-pairing. Malformed required input and a different database generation preserve existing credentials for recovery.
Why This Change Was Made
Startup completes config and state admission before credential writes, then uses the existing migration, backup, and maintenance owners. The Mac app prepares through its matching bundled runtime before starting credential consumers. Rollback restores the previous binding; interrupted completion can resume on the same committed source.
Database porting retains each shared root's local credential companion through forward, reverse, resumed, and rolled-back transitions. Local credentials stay in SQLite and remain included in backups. Preparation does not manage services.
Evidence
The published head is
a9b80488a4e89e5ff3f4e7f27e34f60efa7f498b, integrated with canonical mainac7109377409762eaa5928989dd0295a99975f74. All 62 authored paths retain the exact blobs and modes from reviewed correctiondf709e0a253d4ea6409a617b8b865c3767662f8c. Current-head CI passed with 110 successful jobs, 19 planned skips, and zero failures. Both required gates passed. Its executed test merge was43b5c18b4e96158d77a3e6c4640232409eff5385, from mainfc3a42a7eb87a906597187f18db62201020d275band this head. GitHub merged the PR as5f40d22a366da865a83658698ecfb4bed5f965bbat 09:36:18 UTC on October 21, 2026. All planned typechecks and all three PostgreSQL conformance jobs passed, including the corrected credential-owner typing and canonical discovery cases. The latest corrections type an existing socket fixture, use canonical private profiles in PostgreSQL discovery and deferred legacy-profile migration tests, and await worker retirement before test-directory cleanup. Existing credentials, anchors, directory inventories, schema deferral, authorization, and stable-reference assertions remain covered.bd61ac44806a291b2d59901317dfef7997e8d8b0: pending migration admitted app startup, remount reconciliation retained the identity/private key/token, and retry/relaunch passed.2026.10.5to the exact bd61 package. The update finished, readiness returned 200, the durable message/session survived, and incognito history was cleared. The package SHA-256 was verified. This does not prove authenticated model inference.The broader bd61 CI run completed with failures, including unresolved inference deadlines, saved-input replay, startup registry locking, and startup-corpus timeout attribution. These results are not labeled inherited or fixed. A focused Linux Testbox allocation queued and was stopped before any test ran.
The focused channel-switch diagnostic reproduced a post-plugin Doctor capture-generation failure during package-to-git-dev switching. The core update returned
ok, the run recordedsucceeded, and runtime identity matched. Its plugin maintenance warning failed the lane's strict status assertion. The fixture intentionally omits the native filesystem helper to test fallback. The complete lane artifact retains the actual failure; stable return was not reached.Isolated owner-level comparisons on older canonical
8792e3a68a7ca34f31163fe562dc601292a575aband the published a9 head both accepted consecutive Doctor intervals with no intervening open. On both revisions, real updater ledger writes after an accepted first receipt reproduced the second-interval capture refusal while preserving credentials. A separate baseline read-only reopen also reproduced the error. These establish pre-existing mechanisms, not the full Docker cause. Result collection omits the first auxiliary receipt, and ledger key reuse overwrites its diagnostic; the retained log therefore cannot identify its acceptance or the mismatched expected generation. No capture-warning repair is claimed here.The raw red/green videos below identify predecessor
ac5a1367fbcf8831fdca01cc8463bae826ac082d. They show original startup refusal and packaged recovery after the recorded device number changes; they do not represent the newer candidate. Independent source-blind validation of that package passed five cases and 102 checks, including wrong-generation preservation and revoked-token absence at the client transmission boundary.Red baseline video · Green packaged video · Behavior contract · Independent report · Capture manifest · Artifact manifest
The videos render recorded terminal output with idle gaps shortened. They are not native Mac screen captures. Artifact links expire October 28, 2026 UTC.