Repository navigation
fix(auth): preserve configured auth inheritance owner during cutover - #178533
xiaopan-xydt wants to merge 16 commits into
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 real behavior proof before merge. What this changesThis PR makes shared-auth bootstrap and Doctor relocation account for the configured legacy inheritance owner while preserving main-store credentials and installation isolation. Example: authInheritance.agentId is ops, ops holds openai:inherited, and main has no credentials.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 6 items remain This PR addresses a credential-cutover defect still present on main; the receipt correction introduces no new actionable finding, while credential-sharing direction still needs security-owner review. Priority: P1 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherAuth writes and Doctor consume the selected installation, configuration, legacy databases, and ownership receipts to prepare or relocate the shared credential store used by peer agents. flowchart TD
A[Selected installation and config] --> B[Legacy source selection]
B --> C[Configured owner and main stores]
C --> D[Bootstrap worker]
C --> E[Doctor relocation]
D --> F[Shared ownership and credential state]
E --> F
F --> G[Peer agent authentication]
Technical reviewBest possible solution: Keep source selection in the existing auth lifecycle and Doctor owners, preserve canonical precedence and private overrides, and retain recoverable refusal when both legacy stores contain credentials. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the mismatch between configured inheritance ownership and main-only cutover selection; related runtime evidence supports the Doctor failure, but this review ran no target code. Is this the best way to solve the issue? Using the existing lifecycle and migration owners addresses the producer defect without restoring unconditional legacy fallback; the sharing boundary still needs the recorded owner decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4f858be32c49. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete new exploit was established, but configurable credential promotion requires source-authority proof and exact-head security review. EvidenceSecurity concerns:
What I checked:
PR surfaceSource +399, Tests +376. Total +775 across 14 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (9 earlier review cycles; latest 8 shown)
Reviewed October 21, 2026, 7:12 AM ET / 11:12 UTC (Revision 10). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Addressed the two findings from the latest review at head
Local: Remaining asks are the authority-chain/upgrade behavior proof and the security-owner decisions; no other code findings are open. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Addressed the remaining test-quality item at head The main-fallback lock regression now passes the selected configuration directly to Local: The remaining asks are still the authority-chain/upgrade behavior proof and security-owner decisions; there are no open code findings. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed the PostgreSQL conformance regression at head The bootstrap commit receipt now includes Local: @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Shared-auth migration and bootstrap selected
agents/main/agenteven whenagents.defaults.authInheritance.agentIdnamed a different legacy owner. The cutover then switched ownership tostate-dband stopped reading that owner's local credentials, so peer agents could lose inherited auth.This revision also closes the security-boundary gaps found during review: Doctor could resolve the source from process-global ambient config instead of the selected config; copied-state planning could inspect an auth source outside the copied snapshot; and an explicitly scoped installation write could combine its environment with the ambient installation's auth owner.
User Impact
Installations using a non-main auth inheritance owner now preserve that owner's credentials during shared-store cutover instead of disabling inheritance with an empty canonical store. Explicit
OPENCLAW_AGENT_DIRrelocation, canonicalstate-dbownership, and explicitly scoped installations remain isolated from ambient runtime selection.Why This Change Was Made
OPENCLAW_AGENT_DIR, otherwise the configured inheritance owner (including a customagentDir).cfgrather than the runtime ambient config snapshot.shared-auth-source-outside-snapshot.stateDir, scoped installation environments, and explicit write environments isolated from the ambient runtime auth owner. Normal runtime worker writes still forward the runtime snapshot config.Evidence
OPENCLAW_VITEST_RUNTIME=node pnpm test src/infra/state-migrations.shared-auth-store.test.ts src/agents/auth-profiles/shared-store-bootstrap.async.test.ts src/agents/auth-profiles/shared-store-bootstrap.runtime.test.ts src/agents/legacy-inherited-auth-dir.test.ts src/agents/auth-profiles/path-resolve.shared-store.test.ts src/agents/auth-profiles/store-update.test.ts --maxWorkers=1— 70 passed.researchsource instead of the selectedopsowner, and old copied-state planning returns a planning warning instead ofshared-auth-source-outside-snapshot.opsowner resolvesstate-db; the fix retains B's populatedlegacy-mainsource.legacy-maininstead ofstate-db.node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base origin/main— passed.pnpm check:changed— conflict markers, line-cap, assertion safety, SQLite worker/dialect, format, config docs, plugin boundaries, import cycles, lint core changed files, and related guards passed. The command remains non-green because of environment/baseline failures:tsgorequires GLIBC >= 2.29 while this host has 2.28; existing max-lines findings in unrelatedui/files; and existing dead-export findings insrc/agents/tool-search-catalog.tsandui/src/pages/sessions/view.test-support.tsx.The sensitive-change gate still requires a maintainer
/allow-security-sensitive-changeapproval for the new head.Closes #178421