Repository navigation
fix(auth): preserve shared profile ownership on fresh installs - #128192
vincentkoc merged 15 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 7:20 AM ET / 11:20 UTC. ClawSweeper reviewWhat this changesThis PR backports shared authentication-store ownership and Doctor handling for legacy state to a beta candidate, while refreshing Slack, Docker, and Codex validation fixtures. Merge readinessKeep open for human release-inclusion review. The shared-auth bootstrap is already present on current main, but this protected, member-owned draft targets a frozen beta candidate and needs exact-head upgrade/protocol validation before any backport decision. Priority: P1 Review scores
Verification
How this fits togetherAuthentication profiles are written by setup and provider flows, then read by agent/provider routing. The shared-store bootstrap decides whether a clean installation uses the global state database or leaves legacy and incomplete migration state for Doctor repair. flowchart LR
A[Credential write] --> B[Shared auth ownership check]
B --> C{Legacy or pending state?}
C -->|No| D[Global state database]
C -->|Yes| E[Doctor repair path]
D --> F[Auth profile loader]
E --> F
F --> G[Provider authentication]
Decision needed
Why: This changes durable credential ownership and Doctor recovery on a protected release branch; only maintainers can accept that upgrade risk for the beta. Before merge
Agent review detailsSecurityNone. PR surfaceSource +237, Tests +480, Other 0. Total +717 across 20 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use the current-main shared-store design as the sole canonical implementation and include it in the beta only after exact-head upgrade, Doctor-recovery, and hosted protocol checks show the beta remains operational. Do we have a high-confidence way to reproduce the issue? No live reproduction was established in this read-only review; current source and focused tests define the fresh-root and legacy-state paths the beta validation must exercise. Is this the best way to solve the issue? Unclear; current main supports this owner-boundary design, but the best beta decision depends on exact-head upgrade and Doctor-recovery evidence plus the unavailable direct Codex contract check. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c37eb01d9a1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer release decision for exact head ClawSweeper exact review run This is deferred from beta.3 under the explicit P0-only release scope. Repairing it now would expand the frozen candidate into another auth-owner refactor and invalidate the completed exact candidate, Codex, Doctor, Slack, and Docker proof. It is not a new secret-exposure or security boundary failure, and it does not regress the release blocker repaired by this PR. Post-beta owner: Current behavior evidence is retained in ClawSweeper run |
554baf9
into
release/beta3-candidate-final-20260821
What Problem This Solves
Fixes an issue where a fresh or partially migrated installation could claim the shared authentication profile store before legacy JSON, SQLite, or pending migration evidence had been resolved. It also repairs two release-only test boundaries that could stall or omit the exact beta validation cases.
Why This Change Was Made
The authentication store now establishes ownership once at the shared-store boundary, fails closed to Doctor when legacy or unreadable evidence remains, and keeps shared writes on that owner without a schema bump. Doctor owns cleanup and migration, including dangling legacy links and source-set changes after confirmation. The Slack enterprise startup test uses a one-shot dispatch seam while retaining the real prepared identity and delivery path. The plugin-binding Docker smoke targets both current Vitest entrypoints and aggregates their two focused summaries.
The final Codex 0.149 approval receipt binds those bytes to the frozen candidate ancestry. This PR is rooted at frozen candidate
9a83cbf29d8f637cbe566d809811cb6a13c93664; it does not adopt latermainchanges.User Impact
Fresh installs retain the canonical shared authentication store. Upgrades with legacy, dangling, unreadable, or incomplete migration state receive the Doctor-owned repair path instead of an unsafe ownership guess. A legacy OAuth source that appears after confirmation is left untouched and requires a fresh Doctor run.
Evidence
2423773af6d3e50e22a62f64bd63c4d5a18d58e5.auth.testsuite: 26/26 passed on Blacksmith Testbox through the real prepared identity and delivery adapter.OPENCLAW_CODEX_REPOpinned to cleanrust-v0.149.0commit758ef40f50c1a458425c7cfbf1eb12cbc07af0b0.32635966167proved the split command-escape cases pass as2 + 1; its old single-summary validator then rejected the valid split. Narrow rerun32636598043proved the first summary could fall outside the tail-only scan. Exact head2423773af6dstreams the complete log in bounded 64 KiB chunks and still requires two summaries totaling exactly three. Narrow Blacksmith Testbox run32636795756passed withOK (3 focused tests).rust-v0.149.0/758ef40f50c1a458425c7cfbf1eb12cbc07af0b0:codex-rs/core/src/exec_policy_tests.rs:1010-1053,codex-rs/core/src/exec_policy_tests.rs:1331-1350, andcodex-rs/core/src/exec_policy_tests.rs:2090-2108.Scope And Risk