Skip to content

fix(codex): deduplicate equivalent quota reset timestamps - #3607

Merged
lidge-jun merged 1 commit into
devfrom
codex/3588-normalize-quota-markers
Sep 5, 2026
Merged

fix(codex): deduplicate equivalent quota reset timestamps#3607
lidge-jun merged 1 commit into
devfrom
codex/3588-normalize-quota-markers

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the CodeRabbit-reported duplicate quota warmup after #3588: equivalent epoch seconds and milliseconds now compare as the same reset boundary. Reuses the existing reset-time normalizer, stores new markers in milliseconds, and accepts legacy second-based markers.

Verification

  • Typecheck and whitespace checks passed.
  • Regression assertions added for cross-unit equivalence and old persisted markers.
  • No local tests or test:changed run; final dev Linux CI is the batch gate.

Checklist

  • Single quota marker defect.
  • Existing persisted marker compatibility retained.
  • No credential or outbound-destination change.

Summary by CodeRabbit

  • Bug Fixes

    • Improved quota auto-refresh handling for reset times expressed in seconds or milliseconds.
    • Prevented duplicate refresh-marker updates when equivalent timestamps use different units.
    • Improved retry behavior after failed marker updates and across configuration reloads.
  • Tests

    • Expanded coverage for timestamp normalization, persistence, configuration changes, deduplication, and retries.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 03:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:50:01.138770Z 79e06e0 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: ebb11bf8-c197-48d7-ad6f-b7bf12ec25d8

📥 Commits

Reviewing files that changed from the base of the PR and between 116389a and 79e06e0.

📒 Files selected for processing (2)
  • src/codex/quota-auto-refresh.ts
  • tests/codex-integration/codex-quota-auto-refresh.test.ts

📝 Walkthrough

Walkthrough

Quota auto-refresh now normalizes reset markers expressed in seconds or milliseconds. Due checks and persistence comparisons use canonical values. Integration tests cover deduplication, configuration reloads, process restarts, unit changes, and failed marker-write retries.

Changes

Quota auto-refresh

Layer / File(s) Summary
Reset timestamp normalization and comparisons
src/codex/quota-auto-refresh.ts
The auto-refresh logic imports normalizeResetAt, documents supported marker units, removes the local conversion helper, and normalizes quota, saved, completed, and pending reset timestamps before comparison.
Persistence and retry coverage
tests/codex-integration/codex-quota-auto-refresh.test.ts
Integration tests use canonical millisecond markers and verify cross-unit deduplication, persistence across reloads and restarts, unit changes, and retries after failed marker writes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/3588-normalize-quota-markers

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun
lidge-jun merged commit e449165 into dev Sep 5, 2026
5 of 7 checks passed
@lidge-jun
lidge-jun deleted the codex/3588-normalize-quota-markers branch September 5, 2026 03:48
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant