Repository navigation
refactor(doctor): unify legacy auth migration ownership - #117361
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 7:30 AM ET / 11:30 UTC. ClawSweeper reviewWhat this changesThe PR replaces separate flat-profile, API-key alias, and legacy Merge readinessNo blocking correctness or security finding. This PR moves legacy auth-file normalization into the existing receipt-backed SQLite migration owner, which is the cleaner owner boundary; it remains open because the Priority: P2 Review scores
Verification
How this fits togetherDoctor is OpenClaw’s upgrade and recovery path for persisted operator state. Both the interactive health flow and non-interactive repair sequence process legacy auth files, migrate usable credentials into per-agent SQLite storage, then archive the original source only after verification. flowchart LR
A[Legacy auth profile files] --> B[Doctor health flow]
A --> C[Doctor --fix repair sequence]
B --> D[OAuth sidecar repair]
C --> D
D --> E[Receipt-backed SQLite migration]
E --> F[Canonical auth profiles]
E --> G[Verified source archive]
F --> H[Doctor repair outcome]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -423, Tests -205. Total -628 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one receipt-backed migration owner for all retired auth-file shapes, preserve the current sidecar-before-import ordering, and merge only after the Doctor/auth owner accepts the documented upgrade behavior and archive semantics. Do we have a high-confidence way to reproduce the issue? Yes—current main source shows separate auth-file repair paths in the command and health flows, while the branch routes those shapes through the receipt-backed migration owner; this review did not execute a local migration because the checkout is read-only. Is this the best way to solve the issue? Yes. Centralizing normalization, verification, receipt writes, and archival in the existing SQLite migration owner is preferable to retaining parallel rewriters with different recovery semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a84302cd73aa. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: refactor(doctor): unify legacy auth migration ownership (openclaw#117361) fix(plugins): surface actionable doctor warnings (openclaw#117357) fix(ci): use corrected Kova release evaluator (openclaw#116920) fix(ci): stabilize release validation assertions (openclaw#117377) refactor(memory): use sqlite transcript identities (openclaw#117334) fix(plugins): require tracked owners for targeted updates (openclaw#117333)
* origin/main: refactor(doctor): unify legacy auth migration ownership (openclaw#117361) fix(plugins): surface actionable doctor warnings (openclaw#117357) fix(ci): use corrected Kova release evaluator (openclaw#116920) fix(ci): stabilize release validation assertions (openclaw#117377) refactor(memory): use sqlite transcript identities (openclaw#117334) fix(plugins): require tracked owners for targeted updates (openclaw#117333)
What Problem This Solves
Operators upgrading legacy auth profiles encountered different Doctor repair paths depending on whether they ran interactive Doctor or
openclaw doctor --fix. The older flat-profile, API-key alias, and OpenAI-provider repair paths rewrote or removed persistent credential sources outside the durable SQLite migration receipt owner, creating inconsistent archives and unnecessary upgrade-recovery complexity.Why This Change Was Made
Both Doctor entry points now use one receipt-backed SQLite auth migration owner. It resolves OAuth sidecars before import, folds historical
openai-codexprofiles and references intoopenai, preserves canonical credentials and SecretRefs, verifies imported state, and archives the untouched original bytes; migration ledger writes reuse the existing shared receipt primitives.User Impact
Existing stable and beta installations retain their auth profiles, provider identity, profile order, API keys, SecretRefs, and original recovery archives through one consistent Doctor upgrade flow. Interrupted or repeated repairs remain recoverable and idempotent, with the same public CLI and no new configuration, runtime compatibility path, or SQLite schema change.
Evidence
v2026.7.1,v2026.7.2-beta.6, andv2026.6.33.tbx_01kyye2jhmr4yrpbmr11cvng85: 188 tests passed across seven focused suites:pnpm test src/commands/doctor-auth-flat-profiles.test.ts src/commands/doctor-auth-canonical-api-key-alias.test.ts src/commands/doctor-auth-migration-receipts.test.ts src/commands/doctor-auth-migration-inherited-oauth.test.ts src/commands/doctor-auth-oauth-sidecar.test.ts src/commands/doctor/repair-sequencing.test.ts src/flows/doctor-health-contributions.test.tspnpm openclaw doctor --fix --non-interactivetwice against a copied legacy OAuth/API-key fixture; both runs produced:{"phase":"first","provider":"openai","profiles":["openai:work","openrouter:default"],"archiveCount":1,"archivePreservesOriginalBytes":true,"receiptStatus":"completed","receiptCount":1,"sourceRemoved":true} {"phase":"repeat","provider":"openai","profiles":["openai:work","openrouter:default"],"archiveCount":1,"archivePreservesOriginalBytes":true,"receiptStatus":"completed","receiptCount":1,"sourceRemoved":true}pnpm check:changedcovers formatting, dead exports, architecture guards, production/test typechecks, and lint.gpt-5.6-sol, reasoningxhigh, TruffleHog clean, no actionable findings.30696615396and itsopenclaw/ci-gateboth completed successfully for2747d785d243dffbe6036b7a28ae98eafa59e848.aa2a5c96f69a1be639c602649d4aa2e4de8da0a8through locally observedorigin/main4e47c4cabf8f2901ec781b59d059999211398813changes none of this PR's nine touched files; no owner-boundary overlap, conflict, rebase, or proof refresh is needed for that main movement.