Repository navigation
Add Codex reset-credit redemption flow - #6361
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82b112632d
ℹ️ 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".
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c050ad4e5b
ℹ️ 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".
| connection: CodexConnectionLike, | ||
| idempotencyKey: string | ||
| ): Promise<{ connection: CodexConnectionLike; response: Response }> { | ||
| let refreshedConnection = await refreshCodexConnectionIfNeeded(connection); |
There was a problem hiding this comment.
Refresh Codex tokens through the assigned proxy
This refresh runs before either fetchResetCredits or postConsumeResetCredit enters runWithProxyContext; for a Codex connection with an account-level proxy and an expired/401 access token, the OAuth refresh egresses directly while the reset-credit requests use the proxy. That can fail or violate the pinned egress expected for proxy-bound accounts, leaving redeem unusable in exactly the stale-token path this retry handles; wrap refreshAndUpdateCredentials in the same resolveProxyForConnection/runWithProxyContext path.
Useful? React with 👍 / 👎.
Kept the release 'Banked Reset Credits' label (reverted the PR's cosmetic rename that broke provider-columns/provider-limits-ui tests). Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
958260a
into
diegosouzapw:release/v3.8.46
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Merged into |
…uick pre-flight The heavy release-PR CI (jobs the local --quick pre-flight does not run) surfaced five inherited base-reds: - route-validation:t06 — src/app/api/usage/codex-reset-credit/route.ts (#6361) read request.json() with no Zod validation; add CodexResetCreditBodySchema.safeParse with a 400 on invalid body (behavior only tightened, downstream logic untouched). - GOLDEN provider translate-path — regenerate the snapshot for the new zed-hosted provider (purely additive, no existing provider path changed). - vscode raw-models test — #6241 additively emits supportsThinking + effort_tiers on the models catalog; align the deepEqual expected (no assert removed, 37/37). - docs-counts (Docs-Sync-Strict --strict) — refresh stale counts to code: 75 executors (ARCHITECTURE, CODEBASE_DOCUMENTATION), 19 OAuth providers (ARCHITECTURE), 18 combo strategies incl. the #6396 pipeline strategy (RESILIENCE_GUIDE, AUTO-COMBO, CLAUDE.md).
Codex reset-credit redemption flow (diegosouzapw#6361). Tests 56/56; kept release 'Banked Reset Credits' label (reverted cosmetic rename that broke 2 release tests). Integrated into release/v3.8.46.
…uick pre-flight The heavy release-PR CI (jobs the local --quick pre-flight does not run) surfaced five inherited base-reds: - route-validation:t06 — src/app/api/usage/codex-reset-credit/route.ts (diegosouzapw#6361) read request.json() with no Zod validation; add CodexResetCreditBodySchema.safeParse with a 400 on invalid body (behavior only tightened, downstream logic untouched). - GOLDEN provider translate-path — regenerate the snapshot for the new zed-hosted provider (purely additive, no existing provider path changed). - vscode raw-models test — diegosouzapw#6241 additively emits supportsThinking + effort_tiers on the models catalog; align the deepEqual expected (no assert removed, 37/37). - docs-counts (Docs-Sync-Strict --strict) — refresh stale counts to code: 75 executors (ARCHITECTURE, CODEBASE_DOCUMENTATION), 19 OAuth providers (ARCHITECTURE), 18 combo strategies incl. the diegosouzapw#6396 pipeline strategy (RESILIENCE_GUIDE, AUTO-COMBO, CLAUDE.md).
Codex reset-credit redemption flow (diegosouzapw#6361). Tests 56/56; kept release 'Banked Reset Credits' label (reverted cosmetic rename that broke 2 release tests). Integrated into release/v3.8.46.
Summary
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
src/lib/usage/__tests__/codexResetCredits.test.tssrc/lib/usage/__tests__/providerLimits.test.tssrc/lib/usage/__tests__/providerLimits.public-api.test.tsCoverage Notes
Reviewer Notes