Repository navigation
fix(auth): clean refresh contention diagnostics - #83383
vincentkoc wants to merge 1 commit into
Conversation
|
Codex review: found issues before merge. Reviewed July 1, 2026, 12:51 AM ET / 04:51 UTC. Summary PR surface: Source +38, Tests +152, Docs +1. Total +191 across 5 files. Reproducibility: yes. Source inspection shows current main still flattens refresh_contention causes and rewraps the manager message; the PR tests model that path without requiring live OAuth credentials. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a rebased auth diagnostic fix that preserves current OAuthRefreshFailureError classification, redacts refresh_contention lock details once, removes the changelog edit, and refreshes final-head auth-profile proof. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main still flattens refresh_contention causes and rewraps the manager message; the PR tests model that path without requiring live OAuth credentials. Is this the best way to solve the issue? Mostly yes. The manager/resolver diagnostic layer is the right place for this cleanup, but the branch is not the best merge shape until it is rebased over current auth-failure classification and the changelog edit is removed. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d68ba5edc598. Label changesLabel justifications:
Evidence reviewedPR surface: Source +38, Tests +152, Docs +1. Total +191 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
5d0497c to
d754e78
Compare
|
The useful fix has landed through #101573 as That current-main replay keeps the canonical I recreated the patch because this branch could not be updated by maintainers ( Thanks @vincentkoc for finding and working through this diagnostic bug. Enabling Allow edits by maintainers on future contributor PRs lets us refresh the original branch directly instead of recreating it. |
Summary
refresh_contentiondiagnostics deterministic by avoiding nested file-lock cause flattening in user-facing refresh failures.code/lockPathonOAuthManagerRefreshErrorwhile redacting lock paths from messages and JSON-facing diagnostics, including structured non-Errorcauses.Related PRs and Issues
Verification
git diff --checknode scripts/run-vitest.mjs src/agents/auth-profiles/oauth-manager.test.ts src/agents/auth-profiles/oauth.test.ts: 4 files / 76 tests passed.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/auth-profiles/oauth-manager.ts: 0 warnings / 0 errors..agents/skills/autoreview/scripts/autoreview --mode branchon headd754e783bc69e4c50dd57d79bd9db31519540ea5: no accepted/actionable findings.pnpm check:changedthrough Blacksmith Testbox vianode scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox ...:tbx_01krwxe431qkbdqzyvhcbgggdq, GitHub Actions https://github.com/openclaw/openclaw/actions/runs/26018020246, exit 0. The changed gate widened to all lanes because the rebased branch triggered a 546-file sync/change threshold, so this is broader than the five-file PR diff.Real behavior proof
Behavior addressed: OAuth refresh contention failures no longer expose file-lock paths in user-facing refresh diagnostics, and the contention text is surfaced once instead of duplicated through cause-chain flattening.
Real environment tested: Fresh OpenClaw gwt branch off current
origin/main, with focused local auth-profile tests, focused lint, branch re-review, and Blacksmith Testbox changed-gate proof on the pushed PR head.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/auth-profiles/oauth-manager.test.ts src/agents/auth-profiles/oauth.test.ts;node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/auth-profiles/oauth-manager.ts;.agents/skills/autoreview/scripts/autoreview --mode branch;node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --blacksmith-org openclaw --blacksmith-workflow .github/workflows/ci-check-testbox.yml --blacksmith-job check --blacksmith-ref main --idle-timeout 90m --ttl 240m --timing-json -- CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 pnpm check:changed.Evidence after fix: Regression tests assert
refresh_contentionmessages do not contain the synthetic lock path orfile lock timeout, including structured non-Errorcauses, and that bothOAuth token refresh failedandOAuth refresh failed (refresh_contention)appear only once. Autoreview found no actionable correctness issues, and Testbox-through-Crabbox passedpnpm check:changedwith exit 0.Observed result after fix: Focused auth-profile tests passed, focused oxlint passed, branch review passed, and Testbox changed-gate passed on the pushed head
d754e783bc69e4c50dd57d79bd9db31519540ea5.What was not tested: No live OAuth provider refresh was forced; this is a deterministic diagnostic/redaction hardening path covered by mocked contention errors and manager-level error construction.