Repository navigation
fix(auth): refresh shared OAuth past empty deleted peers - #179205
Conversation
Read historical auth candidates before write admission so empty retained stores cannot block shared OAuth refresh. Possible matches retain all transactional generation, identity, and deletion checks. Add empty and matching completed-deletion manager regressions. Fixes #178908.
…oauth-fence-skips-unrelated-deleted-peer
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 245964158a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Honor the candidate identity in the existing asynchronous auth reader so rediscovered replacement databases do not reuse stale observed identities. Preserve direct identity checks and unchanged write authority. Seed the retained matching-peer fixture before shared inheritance removes the local copy; assert its persisted contents before deletion.
|
Updated head: The first CI run exposed a matching-peer fixture that was being inherited rather than retained, plus a stale observed identity when rediscovering a replacement peer database. Both are repaired. Candidate reads now use discovery's captured identity; stale captures still fail closed and writer authority is unchanged. Changed-file lint/format and a fresh committed-branch P2 autoreview pass. Exact-head CI is running the regression and sibling suites. PR CI is the test gate per explicit maintainer policy; local tests/typechecks and live proof are intentionally skipped. The PR body contains the current evidence and prior CI failures. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…oauth-fence-skips-unrelated-deleted-peer
|
Codex review: needs maintainer review before merge. What this changesThis PR skips unrelated historical OAuth generations before write admission and binds candidate reads to their discovered database identity. Example: The surviving main agent refreshes openai:default while deleted-peer retains an empty auth store and completed deletion journal.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it addresses a source-confirmed OAuth refresh failure, and review found no introduced correctness or security defect. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe auth-profile owner coordinates OAuth refresh across shared and historical agent databases, consuming persisted credentials and deletion authority and producing fenced peers, provider refresh requests, and settled credentials. flowchart TD
A[OAuth manager] --> B[Discover historical stores]
B --> C[Identity-bound credential read]
C --> D[Skip unrelated generation]
C --> E[Matching generation writer admission]
E --> F[Transactional fence and deletion checks]
F --> G[Provider refresh and settlement]
Technical reviewBest possible solution: Keep the identity-bound pre-admission filter and unchanged transactional writer checks. Do we have a high-confidence way to reproduce the issue? Current-main discovery, premature write admission, and completed-deletion refusal establish the empty-store failure path; this read-only review executed no reproduction. Is this the best way to solve the issue? This is the smallest complete repair using existing owners: read the captured candidate before admission, skip definite mismatches, and retain writer-side verification for possible matches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c13eaeedc6c1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +21, Tests +63, Docs +4. Total +88 across 4 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 Reviewed October 21, 2026, 4:19 AM ET / 08:19 UTC. |
|
Merged via squash.
|
…9205) * fix(auth): allow refresh past unrelated deleted peers Read historical auth candidates before write admission so empty retained stores cannot block shared OAuth refresh. Possible matches retain all transactional generation, identity, and deletion checks. Add empty and matching completed-deletion manager regressions. Fixes openclaw#178908. * fix(auth): bind peer reads to discovered file identity Honor the candidate identity in the existing asynchronous auth reader so rediscovered replacement databases do not reuse stale observed identities. Preserve direct identity checks and unchanged write authority. Seed the retained matching-peer fixture before shared inheritance removes the local copy; assert its persisted contents before deletion.
* fix(auth): allow refresh past unrelated deleted peers Read historical auth candidates before write admission so empty retained stores cannot block shared OAuth refresh. Possible matches retain all transactional generation, identity, and deletion checks. Add empty and matching completed-deletion manager regressions. Fixes #178908. * fix(auth): bind peer reads to discovered file identity Honor the candidate identity in the existing asynchronous auth reader so rediscovered replacement databases do not reuse stale observed identities. Preserve direct identity checks and unchanged write authority. Seed the retained matching-peer fixture before shared inheritance removes the local copy; assert its persisted contents before deletion. Release adaptation: the baseline auth row reader has no cached file-state path, so the discovered candidate identity simply overrides the inspected identity. The regression uses the baseline's inline OAuth fixtures instead of main's coordination fixture. (cherry picked from commit c08aa6d)
Adapt 21 audited fixes to release-native ownership and recovery. Retain strict temporary environment isolation and provider-only cooldowns. Original-source provenance and contributor credit: #179144 5a97c90 — Peter Steinberger <[email protected]> #180280 442c2f7 — Jason (Json) <[email protected]> #178596 63f386b — Braden Guliano <[email protected]> #181804 d75915e — Peter Steinberger <[email protected]> #181140 b4031b2 — Peter Steinberger <[email protected]> #182207 b8fae65 — Peter Steinberger <[email protected]> #180792 d2c70dd — Peter Steinberger <[email protected]> #179205 c08aa6d — Peter Steinberger <[email protected]> #179997 f178dd9 — mali <[email protected]> #181270 e204484 — Peter Steinberger <[email protected]> #179031 855b0aa — Peter Steinberger <[email protected]> #179726 3d51d00 — Peter Steinberger <[email protected]> #179249 b617d97 — Josh Avant <[email protected]> #182385 bb13bcd — Peter Steinberger <[email protected]> #182615 411bac2 — Peter Steinberger <[email protected]> #181300 765c2f1 — Peter Steinberger <[email protected]> #179549 09ba994 — Peter Steinberger <[email protected]> #179445 ac5587b — Peter Steinberger <[email protected]> #181127 25dde25 — Josh Lehman <[email protected]> #173209 ebccf57 — Peter Steinberger <[email protected]> #175289 e579f09 — Peter Steinberger <[email protected]> Proof: targeted owner/regression tests; Qwen15 and catalog pool13 pass. Final integrated lint/type/format pass remains pending under user direction. Co-authored-by: RomneyDa <[email protected]>
Fixes #178908
What Problem This Solves
Fixes shared OAuth refresh failing before provider I/O when a deleted agent's retained auth store is empty.
User Impact
Surviving agents can refresh shared OAuth credentials without reopening irrelevant historical stores for writes. Matching generations remain blocked by completed deletion; unreadable stores and changed captured identities still fail closed. No configuration or migration is required.
Why This Change Was Made
The peer writer checked the refresh generation after requesting write admission, so the deletion journal rejected even an empty store. Read through the existing asynchronous auth reader first and skip definitely unrelated generations. Pin candidate reads to discovery's physical identity so rediscovery can read a replacement while stale captures remain rejected. Possible matches retain the unchanged writer transaction and its generation, identity, deletion, and live-authority checks.
Thanks to @WG-Mojo for narrowing the report to an empty retained store and documenting the admission-order defect.
Evidence
c393a44166054c464ca220c7d03df19944f0745a. The pretransaction worker filter introduced in perf(auth-profiles): offload peer settlement and catalog reads #166183 still ran after write-execution capture.f3f9b52cc80eeb6ab8b07d14aaa12565c4f1581a, the auth test job passed. Bothpreserves refresh safety with a retained completed-deletion storecases passed:emptyin 1.13s andmatchingin 1.45s. The existingsettles a replaced peer database discovered after provider refreshregression passed in 2.02s. These check provider invocation, surviving credential settlement, preserved historical auth/journal state, and replacement identity handling.scoped-clean, with no actionable findings. The proposed write-admission recheck was assessed and resolved; the existing profile locks, generation guards, and settlement rescans remain intact.check-test-types-core-2and the aggregate gate remain red due to an inherited CI-planner type error: TS2345 attest/scripts/ci-changed-node-test-plan.test.ts:813,891, whereCompactNodeTestShardlacksconfigs. The exact diagnostics also fail in scheduled main run 39563487228, job 119100317831.