Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
3 tasks
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
Codex delayed weekly-reset confirmation now also accepts an unused rolling weekly window. When the provider advances the weekly reset date with each zero-use observation, the candidate and current boundaries differ by more than 120 s across normal refresh intervals. Previously that pair was discarded as
InconsistentResetBoundary, so stale pre-reset usage persisted.In
delayed_candidate_decision(rust/src/providers/codex/weekly_reset.rs), boundaries more than 120 s apart are accepted only when all of these hold:window_minutes == Some(10080);resets_atis within 120 s of its own capture time + 604800 s (candidate.snapshot_updated_at,current.updated_at);current_boundary >= candidate_boundary.The equivalent-boundary rule (< 120 s apart) is unchanged. Every other guard is unchanged: exact OAuth, plan match, unchanged credit inventory, 60 s minimum age, 30 min expiry,
supported_delayed_boundary, and the threshold checks.Upstream reference
Sources/CodexBar/Providers/Codex/CodexWeeklyResetConfirmation.swift(evaluateDelayedCandidate,unusedWeeklyWindows), tests inTests/CodexBarTests/CodexWeeklyResetDiagnosticsTests.swift(unused weekly boundaries advancing with observation time confirm on later refreshes),docs/codex.md.Ported / Deferred
unusedWeeklyWindowsrelaxation and the upstream test matrix (rolling positive at 180/300/900 s offsets, ordinary publication unchanged, nonzero usage, wrong boundary, plan/inventory guards).initialDecisionrestructuring in the same upstream commit (behavior-preserving), and the Swift persistence/UsageStore test (persisted stale baseline recovers ... rollingBoundary), which exercises Swift store plumbing with no Windows counterpart.resets_at, upstream publishes above 1% used, while localinitial_decisionpreserves becauseis_valid_boundaryfails first.num_seconds()), consistent with the existing 120 s checks in this module.Validation
Toolchain pinned
cargo +1.98.0, process-localCARGO_TARGET_DIR.cargo +1.98.0 fmt --all: cleancargo +1.98.0 clippy --workspace --all-targets -- -D warnings: passcargo +1.98.0 test -p codexbar weekly_reset: 14 passed, 0 failedcargo +1.98.0 test -p codexbar providers::codex: 54 passed, 0 failedNew tests: positive rolling case (180/300/900 s), minimum age still applies, ordinary publication unchanged; negatives for nonzero usage (current and candidate), wrong window minutes (current and candidate), boundary not near capture+7d (current and candidate), current boundary earlier than candidate, changed credit inventory, expired candidate.
Affected areas
UI proof
Not applicable. No UI surface is touched.