Repository navigation
Conversation
Forward caller cancellation through the registered refresh provider and compose it with a fresh 30-second fetch deadline. Apply the same deadline and login cancellation to browser token exchange. Reuse the closed Codex refresh classifier for terminal account-state decisions and redact all provider-controlled descriptions and unknown codes from token errors. Adapt the refresh hardening from source commits f3e3c34, a905ab3 and 8657241 onto current dev. Add synthetic end-to-end coverage for cancellation, deadlines, terminal/transient responses, credential generation races, recovery and redaction. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The registered ChatGPT OAuth refresh provider dropped caller cancellation, had no fetch deadline, and could repeatedly retry expired or invalidated refresh grants. It could also interpret availability failures as terminal from the provider's free-text description.
ChatGptTokenError. The generic refresh path marks only the matching credential generationneedsReauth; transient failures remain eligible for recovery.Prepared on
devatdfea21d2d244b1bdca716857225d32d130f9c7e4. Adapted from source commitsf3e3c34a8bb5d7de7bc30625f0b2834425aee142,a905ab36a7ffce2299544549f1db93985263568eand8657241015b7bb62298ec2769ae88e7ba64ad22f, with browser cancellation and stronger regression coverage added here.This is independent of #6594's import-cycle refactor. Its ChatGPT file move was applied in a separate compatibility worktree, followed by this change using Git's 3-way application: no conflicts, clean typecheck and 81 passing related tests. That refactor is not included in this branch.
Verification
Tests use Bun 1.4.0, as required by
testRunnerBun. Runtime/tooling commands use the installed Bun 1.4.2. Token-endpoint responses are synthetic. No provider credentials, real accounts or paid calls were used. All test commands below were run with an additional--preloadpointing to an untracked offline guard: to reproduce it, wrap the original globalfetchand reject hosts other thanlocalhost,127.0.0.1and::1. Tests replacefetchwith synthetic executors where vendor URLs are exercised.bun run test tests/oauth: 701 pass, 0 fail, 38 files. The same command on pristine basedfea21d2dgives 672 pass, 0 fail.bun test tests/oauth/chatgpt-token-expiry.test.ts tests/oauth/oauth-refresh-generic-lock.test.ts: 39 pass, 0 fail.bun run test:changed tests/oauth tests/codex-integration/codex-account-store-refresh-classification.test.ts tests/codex-integration/codex-main-account-refresh.test.ts tests/lab/core-lab-boundary.test.ts: 698 pass, 0 fail, 35 files, resolved comparisonupstream/devatdfea21d2d.bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/lab/core-lab-boundary.test.ts tests/codex-integration/codex-account-store-refresh-classification.test.ts tests/codex-integration/codex-main-account-refresh.test.ts tests/ci-workflows/structure-ssot.test.ts tests/ci-workflows/repo-hygiene.test.ts: 142 pass, 0 fail.bun run typecheck,bun run privacy:scan,bun run structure:check,bun scripts/file-size-ratchet.ts,git diff --check: pass.docs-site,bun install --frozen-lockfile, thenASTRO_TELEMETRY_DISABLED=1 bun run buildwithXDG_CONFIG_HOMEset to a temporary directory: pass, 569 pages and 79,090 internal links checked.needsReauth, transient preservation and browser cancellation/deadline.8657241015b7bb62298ec2769ae88e7ba64ad22fand the frozen candidate: 0 pass / 1 fail on Devin, 1 pass / 0 fail here. Caller abort leaves Devin's fetch signal un-aborted; this candidate aborts it immediately and preserves the exact callerAbortError. The control is bounded by a 100 ms synthetic harness fallback, not provider traffic.Full repository and platform-matrix tests were not run locally: this is a focused four-file OAuth behavior change plus two required documentation updates, while the repository has over 2,300 test files. Local coverage includes the complete OAuth domain, its shared classifier consumers, import-connected selection and structural/privacy guards. Required upstream CI still needs to run on the submitted head.
A preliminary bare, non-isolated
bun test tests/oauthrun had the same existingoauth-health.test.tsfailure on both base and candidate (Codex reauth action points at the dashboard pool, not ocx login codex, missing entry at line 331). Both complete domain runs pass with the repository's official isolated test wrapper.Checklist
Local auth/security review is complete. Explicit maintainer security review and the
maintainer-sponsoredgate remain required before merge; no label, workflow or security-setting changes are included.