Codex early weekly reset remains stale at 0–1% after #3177; 2% publishes normally
Summary
After an early backend weekly reset, CodexBar continued showing and persisting the pre-reset weekly value of 53% used / 47% left while repeated direct reads from the packaged OAuth helper reported 0–1% used / 99–100% left for the same account, with exact confidence and a materially newer weekly reset boundary.
During the captured stale interval:
- the account-snapshot file was rewritten at two automatic-refresh checkpoints without advancing the public weekly snapshot;
weeklyResetCandidatewas absent in both persisted checkpoint records; and- manual Refresh left the snapshot timestamp, contents, and visible value unchanged.
A subsequent live inspection at 15:04:47 local time captured the persisted app state at 2% used / 98% left with the newer reset boundary. That later value no longer matched the guarded 0–1% reset shape: above 1%, initialDecision returns .publishInitial, so 2% is eligible for the ordinary publication path without delayed reset confirmation.
The live stale-publication symptom is established. The exact #3177 candidate-creation, compatibility, or persistence predicate that failed is not established by the available evidence. The original 59 ms reset-credit-expiry diagnosis is withdrawn.
Verified release context
#3177 was merged as commit 0a1aa53598c94003a87bcdcca4af88b0ad508421. That commit is an ancestor of the official v0.55.1 tag. This is therefore not a request to ship the already-merged #3177 change; it is a report about the reset shape that change was intended to recover.
Observed evidence
| Observation | Time, local | Public/persisted weekly state | Direct OAuth-helper state | Delayed candidate |
|---|---|---|---|---|
| First captured mismatch | 14:02 | 53% used / 47% left; snapshot still reported an older Sep 1 boundary | 0% used / 100% left; newer Sep 3 boundary; exact | not inspected at this instant |
| Automatic-refresh checkpoint | 14:04:49 | account file rewritten; public snapshot still 53% | — | absent in persisted record |
| Second direct helper read | 14:05 | public snapshot still 53% | 1% used / 99% left; same newer boundary; exact | not inspected at this instant |
| Automatic-refresh checkpoint | 14:09:49 | account file rewritten again; public snapshot still 53% | — | absent in persisted record |
| Manual Refresh | 14:12 | after 12 seconds, file timestamp and contents were unchanged; UI still showed 47% left | — | absent in unchanged record |
| Final direct helper control | 14:13 | persisted public snapshot still 53% with Sep 1 boundary | 1% used / 99% left with Sep 3 boundary; exact | absent in persisted comparison |
| Later accepted app state | 15:04:47 | 2% used / 98% left with Sep 3 boundary | — | none persisted after publication |
The directly captured stale interval runs from the first fresh helper observation at 14:02 through the failed manual refresh at 14:12. Sixty-two minutes elapsed between the 14:02 helper observation and the later 15:04 accepted state, but there is no retained sample for every intervening refresh. This report therefore does not claim that continuous staleness for the full 62 minutes is proven.
The direct packaged-helper reads are provider controls. They establish that OAuth authentication and upstream usage retrieval worked, but they do not establish the exact in-memory payload received by each automatic app refresh.
Why the 2% state is a useful control
In the shipped #3177 logic, the reset threshold is 1%. Confirmation is required only when the previous weekly usage is above 1% and the initial fresh usage is at most 1%; otherwise the initial snapshot publishes normally:
This gives a deterministic interpretation of the later observation:
- Fresh values at 0–1% match the guarded reset shape and require confirmation.
- A fresh value at 2% does not match that shape and can publish through
.publishInitial. - The later 2% publication is therefore not evidence that #3177's delayed-candidate recovery succeeded.
- It explains how the visible value could clear without a one-hour quota recalculation or a successful delayed confirmation.
At the two captured automatic-refresh checkpoints, the persisted public snapshot was still 53% and no delayed candidate was present. The evidence does not distinguish among these possibilities:
makeDelayedCandidatereturnednilbecause one of its strict prerequisites failed;- a candidate was produced but rejected by the account-scoped persistence guard;
- a candidate was created and discarded between the sampled file writes; or
- the automatic app refresh received evidence different from the direct helper controls.
Relevant seams:
Correction to the original 59 ms diagnosis
The original comparison normalized the persisted credit expiry to Unix seconds with a fractional component and compared it with the packaged CLI's whole-second ISO-8601 rendering.
That crossed serialization formats:
- the CLI explicitly sets
JSONEncoder.dateEncodingStrategy = .iso8601; - the account-snapshot store uses a default
JSONEncoder, whose numericDaterepresentation preserves fractional precision.
Source references:
Those outputs are compatible with the same in-memory Date. The available CLI output does not prove that the previous, initial, and confirmation observations differed by 59 ms inside the app. Exact expiry equality may still be a brittle seam, but it is not established as the cause of this incident, and this report does not request a Date-comparison change.
Expected behavior
When #3177's bounded sequence receives sufficient consistent exact OAuth evidence for the same account, source, plan, reset boundary, and unchanged positive reset-credit inventory, CodexBar should eventually publish the 0–1% post-reset weekly state. The user should not need to consume enough quota to produce a value above the 1% confirmation threshold.
Actual behavior
- Direct exact OAuth-helper reads returned the fresh 0–1% state and newer reset boundary.
- At two automatic-cadence file writes, the public snapshot remained at 53% and no delayed candidate was persisted.
- Manual Refresh did not advance the snapshot, boundary, update time, or visible value.
- A later 2% state published after the fresh value was above the guarded threshold.
Live reproduction shape
The backend reset is externally timed, so the complete trigger is not locally deterministic.
- Begin with a persisted exact OAuth weekly snapshot above 1% used and an old future reset boundary.
- Have the backend perform an early weekly reset without consuming the available reset credit.
- Use the packaged OAuth helper as a provider control and observe repeated exact 0–1% values with a materially advanced, consistent reset boundary for the same account.
- Observe the app through multiple automatic refresh intervals and invoke manual Refresh.
- Inspect the persisted account record after each checkpoint for the public weekly state and
weeklyResetCandidate. - Separately retain a later observation above 1% as a control for the ordinary publication path.
Requested investigation and safe fix boundary
Please identify the failed candidate stage before changing reset-admission policy. A focused regression should drive the complete sequence through the real admission and file-persistence seams while recording reason-coded outcomes:
- previous exact OAuth state above 1% with the old future boundary;
- repeated exact OAuth states at 0–1% with a consistent advanced boundary;
- stable account, plan, and source;
- the same observed credit ID, reset type, status, and available count across the sequence;
- raw in-memory expiry values captured from the same test observations rather than inferred across encoders;
- at least one refresh after the delayed minimum age;
- a real file-backed account-snapshot store; and
- a 2% control observation proving the ordinary publication path.
Diagnostics should distinguish:
- which
makeDelayedCandidateprerequisite failed, if creation returnednil; - whether account-scoped candidate persistence rejected the refresh guard; and
- which compatibility or age check discarded an existing candidate.
Existing safeguards should remain for single transient low samples, account/source/plan changes, non-exact data, non-monotonic timestamps, inconsistent boundaries, missing credit evidence, changed credit identity/status/count, and stale or expired candidates.
A counterexample that must remain rejected is a single 0–1% observation followed by a rebound, or a low sequence whose account, source, plan, reset boundary, or credit identity changes between observations.
Related work
- #2790: original early-reset stale-quota report.
- #2897: explicitly-zero-credit subcase.
- #3179: unchanged-positive-credit follow-up.
- #3177: merged delayed-candidate recovery intended to address this reset shape; its merge commit is included in v0.55.1.
- #3194: similar successful-fetch/stale-publication symptom; this report does not claim every instance shares one cause.
- #3200: automatic-refresh persistence coverage uses 31%, 42%, and 56%, all above the reset-confirmation threshold.
Evidence status
The UI screenshots, persisted percentages and reset boundaries, helper results, file-write times, candidate absence at the two captured checkpoints, and failed manual-refresh result remain valid observations.
Any earlier evidence text attributing the incident to a 59 ms expiry mismatch is superseded. The corrected evidence preserves the raw observations but classifies the exact failed predicate as unknown.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 30, 2026, 4:35 PM ET / 20:35 UTC.
Summary Keep open: current source confirms that the credits-refresh writer can erase a successfully stored weekly-reset candidate, preventing delayed confirmation and leaving the old weekly value visible. The reporter’s latest v0.56.1 capture matches this path; a separate rolling-boundary compatibility question still needs maintainer direction.
Reproducibility: yes. for the candidate-loss portion: a file-backed account refresh can create a withheld candidate, complete the credits phase, and assert that it remains persisted. The upstream early-reset event itself is externally timed, so it was not executed in this read-only review.
Root-cause cluster
Relationship: canonical
Canonical: https://github.com/steipete/codexbar/issues/3248
Summary: This issue is the active canonical report for the released delayed-candidate lifecycle failure; earlier early-reset work and diagnostics overlap but do not resolve the remaining defect.
Members:
same_root_cause: https://github.com/steipete/codexbar/issues/3179 - It reported the same unchanged-positive-credit early-reset behavior, but was closed by the initial delayed-candidate implementation.partial_overlap: https://github.com/steipete/codexbar/pull/3177 - It introduced the delayed-candidate recovery path but does not establish that the later credits-only writer preserves the candidate.partial_overlap: https://github.com/steipete/codexbar/pull/3276 - It added diagnostics used by the latest capture without changing reset admission or the credits-row overwrite.
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Maintainer decision needed
| Question | Recommendation |
|---|---|
| Should the repository land the narrow candidate-preservation repair now and keep the five-minute rolling-boundary admission change as separate follow-up work? | Land the narrow preservation repair: Carry the existing candidate through credits-only updates and add a full refresh regression without changing any reset threshold or boundary-admission rule. |
Why: The overwrite is a mechanical data-lifecycle defect, but changing delayed boundary equivalence would alter the false-positive safeguards for provider reset publication.
Next step A narrow candidate-preservation repair is source-proven, but the report also exposes an independent rolling-boundary policy question and already carries an explicit no-new-fix-PR/maintainer-review signal.
Review details
Best possible solution:
Preserve weeklyResetCandidate during credits-only row updates and add a file-backed full account-refresh regression; evaluate rolling reset-boundary equivalence as a separate, explicitly approved admission-policy change.
Do we have a high-confidence way to reproduce the issue?
Yes for the candidate-loss portion: a file-backed account refresh can create a withheld candidate, complete the credits phase, and assert that it remains persisted. The upstream early-reset event itself is externally timed, so it was not executed in this read-only review.
Is this the best way to solve the issue?
No as a single policy change: source supports a narrow candidate-preservation repair, while relaxing delayed reset-boundary comparison needs separate safety approval and coverage.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- Preserving the candidate fixes a confirmed lifecycle bug but does not by itself admit the captured five-minute rolling reset boundaries: delayed evaluation currently requires candidate and next-refresh boundaries to differ by less than 120 seconds.
Codex review notes: model internal, reasoning high; reviewed against 56bbc037f616.
Label changes
Label changes:
- add
issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label. - add
clawsweeper:source-repro: Current issue advisory state selects this label. - remove
issue-rating: 🦪 silver shellfish: Current issue advisory state no longer selects this label.
Label justifications:
P2: A released Codex usage-refresh path can leave a stale quota display, but the issue is bounded to a specific reset shape.impact:auth-provider: The failure occurs while processing exact Codex OAuth usage and account-scoped provider state.impact:ux-friction: Users can see an outdated weekly allowance despite successful provider reads and refresh activity.
Evidence reviewed
What I checked:
- Credits refresh drops the candidate: The credits-only writer rebuilds the matched account row but omits its existing weekly reset candidate; the initializer default is nil, so this replaces and persists the row without delayed-confirmation evidence. (
Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:321, 56bbc037f616) - Omitted argument has a destructive default: CodexAccountUsageSnapshot defaults weeklyResetCandidate to nil, confirming that the credits writer's reconstruction clears the existing candidate rather than preserving it. (
Sources/CodexBar/CodexAccountUsageSnapshotStore.swift:19, 56bbc037f616) - Automatic refresh orders usage before credits: The account-scoped refresh awaits provider usage before credits; candidate admission persists the candidate after usage admission, so the following credits phase can erase it in the same refresh. (
Sources/CodexBar/Providers/Codex/UsageStore+CodexAccountState.swift:51, 56bbc037f616) - Candidate persistence occurs before a withheld result returns: The Codex admission path persists admission.pendingCandidate before returning when publication is withheld, establishing the candidate lifecycle that the later credits update must preserve. (
Sources/CodexBar/Providers/Codex/UsageStore+CodexPATRefresh.swift:75, 56bbc037f616) - Released build contains the overwrite: The v0.56.1 tag contains the same credits-row reconstruction without weeklyResetCandidate, so this is present in the reporter's stated release rather than only on current main. (
Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:321, aa041691b091) - Existing coverage misses the combined lifecycle: The rehydration test proves a candidate survives persistence and is later evaluated, but it invokes provider refreshes directly and does not exercise the succeeding account-scoped credits refresh that rewrites the row. (
Tests/CodexBarTests/CodexWeeklyResetPublicationTests.swift:72, 56bbc037f616)
Likely related people:
- steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- Zihao-Qi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.
Correction after additional live observation and serialization review:
The issue self-recovered at 15:04:47 local time, when the fresh exact OAuth value reached 2% used / 98% left. This was not a one-hour recalculation. The reset-confirmation gate applies only while fresh usage is at most 1%; at 2%, initialDecision returns .publishInitial, so the next scheduled refresh accepted the value normally.
I also need to withdraw the proposed 59 ms expiry diagnosis. The packaged CLI encodes dates as ISO-8601 at whole-second precision, while the persisted account snapshot uses the default numeric Date encoding and preserves fractional seconds. The .059 versus .000 comparison therefore crossed serialization formats and does not prove that the app's in-memory credit expiries differed.
The live defect remains: exact OAuth repeatedly reported 0–1% with the new boundary while the public snapshot stayed at 53%, manual refresh did not advance it, and no delayed candidate was present at the captured automatic-refresh checkpoints. The strongest proven boundary is that the stale state persisted for at least 62 minutes and cleared only when fresh usage rose above the 1% confirmation threshold.
I have edited the title and body to separate those observations from the now-withdrawn causal inference. Please disregard the prior expiry-tolerance proposal and re-evaluate which #3177 candidate-creation or persistence guard failed in the live sequence.
@clawsweeper re-review
🦞🧹 ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.
Final correction after a full evidence and source re-audit:
I replaced the issue body in full. Two precision corrections go beyond my previous follow-up:
- The stale state is directly confirmed from the first fresh helper read at 14:02 through the failed manual refresh at 14:12. Sixty-two minutes elapsed before the later accepted 2% snapshot at 15:04:47, but there is no retained sample for every intervening refresh. My earlier wording that the failure was proven to last "at least 62 minutes" was too strong and is withdrawn.
- The packaged-helper reads are provider controls. They prove OAuth authentication and upstream usage retrieval worked, but they do not prove the exact in-memory payload received by each automatic app refresh.
The corrected scope is now:
- persisted public state remained at 53% with the old boundary;
- direct exact OAuth-helper reads returned 0–1% with the newer boundary;
- the account file was rewritten at 14:04:49 and 14:09:49 while the public state remained stale and
weeklyResetCandidatewas absent in both captured records; - manual Refresh at 14:12 did not change the file or UI; and
- a later persisted 2% state is a control for the ordinary
.publishInitialpath above the 1% threshold, not proof that delayed-candidate recovery succeeded.
I also reverified that #3177's merge commit is contained in the official v0.55.1 tag. The live stale-publication symptom remains valid, but the precise candidate-creation, compatibility, or persistence predicate that failed remains an evidence gap. The 59 ms expiry theory and any proposed expiry-tolerance fix remain withdrawn.
The current ClawSweeper review's "trace before broadening admission" conclusion is consistent with this corrected scope. Please re-review once more so the durable review is based on the fully replaced body and the corrected timing boundary.
@clawsweeper re-review
🦞🧹 ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.
Re-review progress:
- State: Complete
- Detail: The durable review result and its route handoff completed.
- Run: https://github.com/openclaw/clawsweeper/actions/runs/33110096573
- Updated: 2026-08-27T19:47:12.479Z
Precision clarification; this does not change the core stale-publication report or the diagnostic-first maintainer request:
- The later persisted 2% observation establishes only that the app had accepted a 2% state by 15:04:47. Source inspection shows two non-delayed ways a valid 2% sample could be accepted:
.publishInitialif 2% was the refresh's initial sample, or.publishConfirmationif the initial sample was 0–1% and the immediate confirmation sample rose to 2%. Because there are no retained samples between 14:12 and 15:04:47, the observation does not prove which branch accepted 2%, when the stale state first cleared, or whether delayed-candidate recovery had already succeeded at 0–1% during that interval. References above that specifically attribute the observed recovery to.publishInitial, or treat the 2% state as proof that delayed recovery did not succeed, are withdrawn. The title's "2% publishes normally" is intended only as shorthand for 2% being eligible for a non-delayed publication path subject to the standard timestamp and boundary guards, not as proof of the branch taken or the time of recovery. - The attached archive does not contain a retained record of the 15:04:47 2% state; that is a later user observation recorded in the issue and comments. The archive also does not contain raw copies of both automatic-refresh checkpoint records or a raw manual-refresh before/after capture. Those earlier events are recorded in the archive's timeline, but they are not independently reconstructible from the attachment. The archive's retained machine-readable comparison is a redacted summary of the stale 53% public state versus the direct 1% OAuth-helper result, together with the UI screenshots.
- "Early backend weekly reset" is the interpretation most consistent with the reset-shaped provider evidence: usage dropped to 0–1%, the weekly boundary advanced materially, and the observed available-credit identity and count were unchanged. The backend event itself was not directly captured.
- In the safe-boundary counterexample, the item that must remain rejected is the low-reset hypothesis replacing the trusted previous snapshot after only one low sample, or after a sequence with an incompatible account, source, plan, reset boundary, or credit identity. A rebound above 1% is eligible for ordinary publication if it passes the existing non-reset-shape admission guards. "Boundary changes" means changes outside the existing compatibility rules, not every small boundary variation.
The exact automatic-refresh input remains unknown, so the evidence does not establish whether a candidate-creation, compatibility, or persistence predicate failed, or which one. The requested next step remains reason-coded app-side diagnostics before changing reset-admission policy.
Added diagnostic groundwork in #3276 (e0d2fd90be45), while keeping this issue open. The stale-reading symptom is not being declared fixed: the app-side input or rejected guard behind the original incident is still unknown.
The existing codex-weekly-reset-publication debug category now includes fixed reason codes for candidate creation, pruning, delayed revalidation, and account-scoped storage requests. These distinguish source/confidence, timing, boundaries, account/plan compatibility, credit inventory, and persistence guards without adding account or credit identifiers. The decision and its reason come from the same predicates; no admission rule, tolerance, ownership guard, or persisted schema was relaxed.
One important distinction: storeRequested means the existing file-store call was made, not that writing to disk succeeded. A regression test covers an unwritable destination and preserves that best-effort contract.
The next occurrence can therefore provide app-side reason codes instead of inferring the rejected condition from separate CLI and snapshot encodings. Raw credentials, account IDs, credit IDs, and provider payloads are not needed. Verification details.
Live capture on v0.56.1: the weekly reset candidate is written to disk, then removed ~1.2 s later
Bottom line: persistPublishedCodexCreditsIntoAccountSnapshotsIfNeeded (Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:320-327) rebuilds the account row without weeklyResetCandidate on every automatic refresh in this capture, ~1.2 s after the candidate is written — that timing is directly sampled on 4 of the 16 cycles. No candidate ever survived to the delayed-confirmation stage. Identified by elimination: that writer emits no log line. User-visible effect: the menu bar continued to show the 58%-used weekly value stamped 2026-08-29T17:28:35Z.
The diagnostics added by #3276 show that evaluateDelayedCandidateCreation does not reject and the account-scoped persistence guard does not reject — the two predicates I previously suspected. This is a report of what I observed. I am not proposing a fix or a behavior change.
Bundle commit e8e27551110, build 132. This is a new occurrence, not a re-observation of the August 27 incident, and it does not establish August's cause: the stale state here was first persisted 2026-08-29T17:28:35Z, before this bundle was built (CodexBuildTimestamp 2026-08-30T10:09:30Z). All 16 captured cycles are on this build.
What is persisted, and what is rendered. The persisted weekly value is 58% used (evidence file 05); 100 − 58 is the arithmetic relating that to a "42% left" reading. Evidence file 11 is a menu-bar screenshot showing the rendered 42%, taken at a moment when a concurrent read of the persisted file returned usedPercent: 58 with snapshot.updatedAt still frozen at 2026-08-29T17:28:35Z. The screenshot carries a clock but no date, so it is the concurrent read that dates it, not the image. The app's own OAuth reads in the capture cycles report 0.000%. Across the 48 logged lines that carry it, previousSnapshot.updatedAt takes exactly one value — 1788024515 = 2026-08-29T17:28:35Z — spanning the full 15:28:15Z–16:43:18Z window. That is a directly observed 75-minute freeze across 16 consecutive cycles.
Extending backward from there is derived, not sampled. snapshot.updatedAt was 22 h 44 m old at the last direct file sample (16:13:18.958Z) and 23 h 14 m old at the last log line carrying that field (16:43:18.517Z). Direct file sampling is discontinuous: file 04's rows span 15:28:59.833Z–15:33:19.719Z and file 09's span 16:02:02.759Z–16:13:18.958Z, leaving 28 m 43 s unsampled at the file level. The diagnostic log covers that interval continuously, at the 15:38, 15:43, 15:48, 15:53 and 15:58 cycles. That no publication occurred across the intervening hours follows from the publication writer (UsageStore+Refresh.swift:953-958) writing a fresh snapshot, so a publication would have advanced the value — given the single stable active account, for which that writer's guards at :919-945 resolve. The window also crosses a process boundary: this bundle's CodexBuildTimestamp is 2026-08-30T10:09:30Z (evidence file 01), after the 2026-08-29T17:28:35Z stamp, so an upgrade and relaunch occurred inside it.
What the app observed, per its own diagnostics
| Published / persisted | Initial observation | Confirmation observation | |
|---|---|---|---|
| weekly used | 58% | 0.000% | 0.000% |
weekly resetBoundary |
2026-09-03T16:24:48Z | 2026-09-06T15:33:16Z | 2026-09-06T15:33:17Z |
updatedAt |
2026-08-29T17:28:35Z (frozen) | 2026-08-30T15:33:17Z | 2026-08-30T15:33:18Z |
accountKnown / planKnown |
true / true | true / true | true / true |
creditsAvailableCount |
1 | 1 | 1 |
Values are from the 15:33 cycle; resetBoundary and updatedAt advance ~300 s per cycle, while 58% and 0.000% do not. At the confirmation and candidateCreation stages the log reports stableAccountCompatible=true, stablePlanCompatible=true, initialConfirmationAccountMatches=true (all unknown on stage=initial). dataConfidence, sourceLabel and credit status are not logged; evidence file 08 records which are directly present in the persisted file and which are entailed by candidateCreation decision=created.
Decision sequence — identical on all sixteen captured cycles
15:33:17.310Z stage=initial decision=requiresConfirmation
15:33:18.202Z stage=confirmation decision=preservePrevious
15:33:18.202Z stage=candidateCreation decision=created reason=candidateCreated
15:33:18.205Z stage=candidatePersistence decision=storeRequested
Sixteen consecutive cycles, 15:28:15Z–16:43:18Z, one distinct sequence. File logging was enabled at 15:25:19.640Z on an already-running app; no codex-weekly-reset-publication line exists before 15:28:15.694Z, and evidence file 02 is byte-identical to the live log's first 64 such lines.
stage=delayedConfirmation appears zero times. UsageStore+CodexWeeklyResetConfirmation.swift:101-118 logs that stage unconditionally whenever candidateForRetry is non-nil, before the decision is acted on at :118. Three returns emit no line in this category at all — the non-success guard at :48-50, codexMissingWeeklyAdmission at :63-71, and .publishInitial, whose stage=initial line is suppressed at :291 — so unlogged cycles are possible in general. But all three precede or bypass the stage=initial log at :76, so each of the 16 cycles that logged requiresConfirmation provably reached :101. candidateRetention, logged by the rejection path at :40-47, is also absent. So pendingCandidate was nil on entry to every one of those 16 passes: no candidate survived from one refresh to the next.
delayedConfirmation is also the only stage that can publish a candidate — .publishCurrent is produced only at CodexWeeklyResetConfirmation.swift:370 and consumed only at UsageStore+CodexWeeklyResetConfirmation.swift:119.
The only reason code emitted anywhere is candidateCreated, a success code. No failure reason code appears.
The candidate reaching disk, then being removed
Evidence file 09, polling codex-account-snapshots.json at 0.1 s. The capture script (file 10) writes a row when the mtime, candidate presence, credits.updatedAt or snapshot.updatedAt changes, plus an unconditional first row. sample/mtime are local EDT (UTC−4):
sample(EDT) mtime(EDT) candidate credits.updAt(Z) snap.updAt(Z) weeklyUsed%
12:02:02.759 11:58:20.120 False 15:58:19.884Z 17:28:35.202Z 58
12:03:18.104 12:03:18.078 True 15:58:19.884Z 17:28:35.202Z 58
12:03:19.559 12:03:19.512 False 16:03:19.201Z 17:28:35.202Z 58
12:08:18.110 12:08:18.084 True 16:03:19.201Z 17:28:35.202Z 58
12:08:19.253 12:08:19.227 False 16:08:19.001Z 17:28:35.202Z 58
12:13:17.921 12:13:17.828 True 16:08:19.001Z 17:28:35.202Z 58
12:13:18.958 12:13:18.950 False 16:13:18.643Z 17:28:35.202Z 58
Each candidate=True write precedes its candidatePersistence storeRequested log line by 1 ms, consistent with store at UsageStore+CodexWeeklyResetCandidatePersistence.swift:68 preceding the log at :70. Each following candidate=False write arrives 1.434 s, 1.143 s and 1.122 s later, and advances credits.updatedAt while leaving snapshot.updatedAt frozen. A fourth transition was captured at the 15:33 cycle (file 04, 1.410 s) without the credits columns. Across the four, the candidate exists on disk for 1.122–1.434 s, against the ~300 s interval to the next refresh — which is the first point at which evaluateDelayedCandidate would see it.
Each candidate=True row still carries the previous cycle's credits.updatedAt — the candidate writer preserves existing.credits at :47 — so the credits advance belongs to the second write.
The ordering is structural on the automatic path. UsageStore.swift:807-809 calls scheduleCreditsRefreshIfNeeded only after the refresh task group at :785-804 — which contains the Codex fetch and therefore candidate persistence — has returned, dispatching into a detached Task(priority: .utility) at UsageStore+CodexRefresh.swift:28. The ~1.2 s offset is then the awaited loadLatestCodexCredits at :96 before the MainActor.run block at :101-110. Note that on enrichmentMode == .forcedForeground (manual Refresh) the credits refresh is instead a sibling task in the same group at UsageStore.swift:802, so ordering there is a race, not a sequence — outside this capture.
Where that second write comes from
weeklyResetCandidate is a defaulted parameter on CodexAccountUsageSnapshot.init (Sources/CodexBar/CodexAccountUsageSnapshotStore.swift:13-28), so a call site that rebuilds a row without naming it drops it silently. Exactly five call sites reach the store. (grep 'codexAccountUsageSnapshotStore?.store' finds only four; writer 5 binds the store to a local at UsageStore+CodexWithheldPublicationError.swift:31.)
| # | Site (under Sources/CodexBar/) |
Names the field? | Consistent with the observed write? |
|---|---|---|---|
| 1 | Providers/Codex/UsageStore+CodexWeeklyResetCandidatePersistence.swift:68 |
yes | no — logs on all seven return paths; exactly one candidatePersistence line exists per cycle |
| 2 | UsageStore+TokenAccounts.swift:297 |
yes (:278-284) |
no — writes only a multi-account fan-out; refreshCodexVisibleAccountsForMenu early-returns at :214-217 when limitedCodexVisibleAccounts(...).count is not > 1. I did not observe the visible-account count directly; the single persisted record (01-environment.txt) is a proxy for it |
| 3 | Providers/Codex/UsageStore+CodexRefresh.swift:327 |
no | yes — called at :109, as ordered above |
| 4 | UsageStore+Refresh.swift:960 |
no | no, on two independent grounds: it writes a fresh snapshot (:953-958, via :502), which would advance snapshot.updatedAt, and every observed clobber leaves it frozen at 17:28:35.202Z; and it is unreachable when publication is withheld (Providers/Codex/UsageStore+CodexWeeklyResetConfirmation.swift:188-191 → Providers/Codex/UsageStore+CodexPATRefresh.swift:91 → the guard at UsageStore+Refresh.swift:447-449, so :780/:502 are never entered) |
| 5 | Providers/Codex/UsageStore+CodexWithheldPublicationError.swift:40 |
yes (:51-60) |
no — returns at :36-38; the live record has no error key |
Non-writer transforms were checked and cleared — see bundle file 08. Separately, writer 2's early return at :214-217 also clears codexAccountSnapshots in memory (= []) without writing to the store, so it cannot produce the observed disk transition.
That leaves writer 3 as the only site consistent with the observed write. This is identification by elimination — writer 3 emits no log line, so its execution was not directly observed.
// Sources/CodexBar/Providers/Codex/UsageStore+CodexRefresh.swift:320-327
// (trailing comments are mine, not in the source)
let row = self.codexAccountSnapshots[index]
self.codexAccountSnapshots[index] = CodexAccountUsageSnapshot(
account: row.account,
snapshot: row.snapshot, // preserved (stale)
error: row.error,
sourceLabel: row.sourceLabel,
credits: self.credits) // replaced (fresh)
// weeklyResetCandidate omitted -> nil
self.codexAccountUsageSnapshotStore?.store(self.codexAccountSnapshots)
:321 (in-memory rebuild) and :327 (disk write) are consecutive unconditional statements in one function, so the observed disk write entails the in-memory clear. The candidate for the next pass is read from memory: UsageStore+Refresh.swift:279 → :335 (pendingWeeklyResetCandidate: hydratedPrior?.weeklyResetCandidate).
This file is byte-identical at v0.55.1, v0.56.1 and the shipped bundle commit.
Reproducing the disk write locally, without a backend reset
persistPublishedCodexCreditsIntoAccountSnapshotsIfNeeded() drops the field unconditionally. Two preconditions, or the check silently no-ops:
- it early-returns at
UsageStore+CodexRefresh.swift:307whenaccountKeyis nil, and at:319unless exactly one row matches (withactiveVisibleAccountIDdisambiguation at:314-318), so the store must first be routed through something that populateslastCreditsSnapshotAccountKeyand the refresh guard —await store.refreshCreditsIfNeeded()does this; Sources/CodexBar/UsageStore.swift:508-509leavescodexAccountUsageSnapshotStorenil unlessstartupBehavior.automaticallyStartsBackgroundWorkis true, so the on-disk half needs a store injected. The in-memory half needs nothing extra.
Tests/CodexBarTests/CodexMonthlyCreditPreservationTests.swift:381 already drives this call on a live UsageStore seeded at :353-360, after refreshCreditsIfNeeded() at :374. Because refreshCreditsIfNeeded() itself reaches :109, seed the candidate after :374.
For the live shape, the reset conditions are as described in the issue body: an exact OAuth weekly snapshot above 1% used, and a backend reset without the credit being redeemed (externally timed, not locally deterministic). My capture setup was Verbosity at debug/verbose/trace with file logging on, then grep 'codex-weekly-reset-publication' ~/Library/Logs/CodexBar/CodexBar.log and evidence file 10 against the snapshot file.
Limits
- The clobber transition is directly observed on 4 of 16 cycles; 3 of those carry the
credits.updatedAt/snapshot.updatedAtcorrelation. The remaining cycles show only the end state pluscreated+storeRequested. Two writes inside one 100 ms poll would collapse into one row, so six state changes in file09is a lower bound. - Writer 3 emits no log line; its identification is by elimination.
- I have not verified what would restore publication. A candidate surviving the write would still need
hydratedPriorto resolve atUsageStore+Refresh.swift:291-302, and — computed in the following comment — would have been rejected atCodexWeeklyResetConfirmation.swift:351on this data. Repairing the write alone is not established to restore publication here. - Whether the August 27 incident shares this cause is not established; its causal attribution remains withdrawn.
- Manual Refresh did not change the reading, but no manual refresh occurred during the instrumented capture — that is a self-report, and per the ordering note above the automatic and forced-foreground paths differ.
- The
codex-weekly-reset-publicationcategory and theinitial/confirmation/delayedConfirmationstages existed in v0.55.1. #3276 added the reason codes and thecandidateCreation/candidateRetention/preservedInitialCandidate/candidatePersistencestages, which is what made this visible. - The snapshot store writes with
options: [.atomic](CodexAccountUsageSnapshotStore.swift:205), so a torn read cannot produce the observed transition.
The reproduction is still live. I can capture further cycles, or run a patched build against this live state and report whether a delayedConfirmation line appears — which would close the in-memory half of this directly rather than structurally.
A second observation about the reset boundary reported during this same capture follows in the next comment. It is computed rather than observed, and is separable from everything above.
Same capture, separate observation: the reset boundary reported while a window is unstarted
This is a computed observation, not an executed one. The guard discussed below never ran during the capture, because no candidate survived long enough to reach it (see the previous comment). I am not proposing a fix or a behavior change; I am recording what the boundary values were and what they would imply.
Bearing on the previous comment: on this data, a candidate that survived the write would still have been rejected at :351. Repairing the write alone would not have restored publication here.
Same environment: official v0.56.1 (build 132), bundle commit e8e27551110, refreshFrequency: fiveMinutes, one Codex account on prolite.
Why the delayed path was the only route on this data
The confirmation path returned .preservePrevious at CodexWeeklyResetConfirmation.swift:222-226: the observation (2026-08-30T15:33:18Z) is 4.04 days before the previously known boundary, and the reset credit is still available on all three snapshots, so resetCreditEvidence is .none.
What the boundary values look like
The persisted record (evidence file 05) shows, against a single snapshot.updatedAt of 2026-08-29T17:28:35.203Z shared by all three windows, a used and an unused window differing at the same instant:
| window | used% | resetsAt − updatedAt |
|---|---|---|
weekly secondary |
58% | 428172.80 s — fixed |
codex-spark-weekly |
0% | 604798.80 s — one week − 1.20 s |
codex-spark 5-hour |
0% | 17998.80 s — five hours − 1.20 s |
File 07, 22 h later, shows three unstarted windows at whole-second precision, all at one week − 1 s or five hours − 1 s against their own updatedAt.
resetsAt is the provider's reset_at, decoded as an Int (Sources/CodexBarCore/Providers/Codex/CodexOAuth/CodexOAuthUsageFetcher.swift:215 → CodexReconciledState.swift:154-162); updatedAt is stamped locally when the response is decoded. CodexRateWindowNormalizer only reorders session/weekly by windowMinutes and does not rewrite resetsAt. The ~1.20 s deficit is the same magnitude as the 1.122–1.434 s gap in the previous comment and is consistent with request-to-decode latency, but I did not instrument request timing, so that is a consistency note rather than a measurement.
What that would mean at the :351 comparison
evaluateDelayedCandidate compares the candidate's boundary with the current one at CodexWeeklyResetConfirmation.swift:351-353, within resetEquivalenceToleranceSeconds (120 s), before the age check at :369. The candidate holds the confirmation snapshot (CodexWeeklyResetConfirmation.swift:291-294); current is the next cycle's initial snapshot (UsageStore+CodexWeeklyResetConfirmation.swift:105).
That guard never executed during this capture. Computed from the app's own logged boundaries at this machine's 300 s interval, the fifteen consecutive candidate-to-next-initial spans are 297–301 s against the 120 s tolerance. Had a candidate survived, :351 would have been the first guard to reject it — every preceding guard passes on this data (:305 age within [0, 1800]; :311 exact OAuth and :317 all three .exact — both entailed by candidateCreation decision=created rather than logged, see the previous comment; :321-344 weekly present, 58 > 1, 0 ≤ 1, 0 ≤ 1; :345-350 all three validResetBoundary non-nil).
I did not test other refresh intervals and make no claim about them. This is also specific to a window that is still unstarted; a window with usage on it reports a fixed boundary, as the table above shows.
The constants (:82-86) and the :222-226 guard are byte-identical at v0.55.1, where the boundary comparison sits inside a compound guard at :329-330 with no reason code. That file differs by +124/−88 overall.
What the current test suite covers
Tests/CodexBarTests/CodexWeeklyResetDiagnosticsTests.swift already pins the :351 rejection: :139 supplies the case, :148 drives evaluateDelayedCandidate with current.boundary = newBoundary + 120, :154 asserts .discardCandidate / .inconsistentResetBoundary. (:82-86 of that file pins a 119.999/120.0 cutoff on the creation-stage guard at CodexWeeklyResetConfirmation.swift:277, a different comparison sharing the same constant.)
A rolling boundary is modelled at CodexWeeklyResetConfirmationTests.swift:243 (604798 s offset), but only against initialDecision/confirmationDecision.
Fourteen of the fifteen evaluateDelayedCandidate call sites in Tests pass one fixed boundary to both candidate and current, so abs(candidateBoundary − currentBoundary) is 0 there and the :351 comparison is trivially satisfied. The fifteenth, CodexWeeklyResetDiagnosticsTests.swift:148, is the only site that varies it, via the nil and +120 mutations at :138-139. The full set is CodexWeeklyResetConfirmationTests.swift:702, 709, 716, 763, 769, 775, 781, 787, 835, 841, 852 (inside the @Test functions declared at :643, :725, :796) and CodexWeeklyResetDiagnosticsTests.swift:107, 119, 148, 177.
Limits
:351was never executed. Its rejection is computed from logged boundaries.- The boundary observation covers one account, one plan, 16 cycles and two persisted records.
- The ~1.20 s deficit in the file
05table is unexplained beyond the consistency note above. - I did not measure any refresh interval other than 300 s.
Evidence bundle is attached to the previous comment and serves both.
The previous ClawSweeper review asked for reason-coded admission diagnostics before any change to reset-publication policy, and for the failed guard to be identified. Those diagnostics shipped in #3276, and these two comments are a capture using them.
The answer to "which guard failed" appears to be: none. Candidate creation and account-scoped persistence both succeed, and no failure reason code is emitted anywhere in the capture. The candidate is discarded after admission, by a writer outside the admission path. No policy change is requested.
@clawsweeper re-review
🦞🧹 ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.
The credits-writer candidate loss is fixed on main in #3302 (5a18e8ee9dc7). Thanks @kcharlan: your lifecycle capture identified the important boundary—the credits-only writer was rebuilding an account row without its already-admitted weekly-reset candidate.
The repair carries that existing field through both credit replacement and clearing. A synthetic file-backed regression first failed on main, then passed through the actual usage→credits sequence, disk reload/relaunch, and a later eligible low-usage confirmation. The credits loader is explicitly observed, so the regression cannot pass by skipping the credits phase. Broader account/reset/credit/architecture coverage passed 215 tests, and repository checks and isolated review passed. The full local suite passed 974 selections in 82 groups, with one recovered unrelated login-fixture retry and no timeouts. Exact-head CI passed all nine checks.
Keeping this issue open. The patch does not change the 1% threshold, minimum age, expiry, account/workspace guards, reset-credit evidence, or 120-second boundary tolerance. The separately reported 297–301-second rolling-boundary differences can still fail that compatibility check. This does not claim that preserving the candidate alone resolves the full captured live symptom, or that the externally timed backend reset was reproduced here. The fix is on main, not in a new release yet.
Additional reproduction on the official signed macOS build CodexBar 0.55.1 (130):
- The Codex provider card showed Weekly 1% left, source
oauth, Updated 6h ago. - A fresh read from the bundled OAuth helper returned an exact snapshot at roughly 08:29 UTC with 0% used / 100% left, a newer weekly reset boundary (Sep 7), and 1 available reset credit.
- CodexBar's account and widget snapshots still contained 99% used / 1% left, the older boundary (Sep 6), and the older update time (roughly 02:29 UTC). The persisted
weeklyResetCandidatewas absent. - Clicking the provider's Refresh rewrote both snapshot files but retained those stale values. The Debug pane then recorded
codex.oauth ... error=Codex API error 503 ... connection termination. - A few minutes later, standalone helper reads returned 1% used with the same newer boundary, so the initial 0% was transient; the app nonetheless remained pinned to the prior-cycle snapshot.
This appears to be another live reproduction of #3248 on the released build, not a new issue. No email address, account/workspace identifier, local username/path, credential, or raw provider response is included.
0.56.2 capture: the persisted weekly value does not change; all 11 delayed evaluations in this window end in inconsistentResetBoundary
Installed bundle is 0.56.2 (build 133), commit 29536872a71, which contains #3302 (a repo fact, not a bundle one). The log carries no version stamp; evidence file 04 records the chain from the log file to the bundle version.
Evidence file 02 is every codex-weekly-reset-publication line between 16:22:21.344Z and 17:17:22.230Z, verbatim — 59 lines, 12 stage=initial, spaced ~5 minutes apart within that span. It is a selected span, not the whole run: logging on this build restarts at 14:22:20.116Z and lines exist between then and 16:22:21.344Z that are not included. The line immediately preceding the span is [2026-08-31T16:22:21.343Z] … decision=discardCandidate reason=expiredCandidate stage=candidateRetention, also not included.
The persisted and previous-snapshot weekly values do not change. On all 47 lines of file 02 that carry them, previousSnapshot.weeklyUsedPercent is 58.000, previousSnapshot.updatedAt is 1788024515, missingWindowBackfillSnapshot.present is true and missingWindowBackfillSnapshot.weeklyUsedPercent is 58.000 — one distinct value each. (initial.weeklyUsedPercent and confirmation.weeklyUsedPercent are 0.000 on those same lines.)
Evidence file 03, the persisted account record read after the last cycle, carries snapshot.secondary.usedPercent 58, snapshot.updatedAt 809717315.202801 (Apple reference-date seconds — 2026-08-29T17:28:35Z), snapshot.codexResetCredits.availableCount 1, and snapshot.codexResetCredits.credits[0].status available.
Evidence file 06 is a 0.1 s poll of codex-account-snapshots.json between 16:46:45.636Z and 17:17:23.298Z. Across its 15 rows, weeklyUsed% reads 58 and snap.updAt reads 17:28:35.202Z on every row.
stage=delayedConfirmation appears 11 times. In the 16 cycles of the 0.56.1 capture it appeared 0 times.
All 11 carry decision=discardCandidate reason=inconsistentResetBoundary. One of them, excerpted from file 02 (timestamp abbreviated, other fields elided, field order changed, level tag, subsystem prefix and message text removed):
16:27:24.549Z stage=delayedConfirmation decision=discardCandidate reason=inconsistentResetBoundary
confirmation.resetBoundary=1788798141 initial.resetBoundary=1788798444
Decisions across all 59 lines: requiresConfirmation 12, preservePrevious 12, created 12, storeRequested 12, discardCandidate 11. Of the 23 lines carrying a reason: candidateCreated 12, inconsistentResetBoundary 11.
One confirmation.updatedAt value appears in two cycles. confirmation.updatedAt=1788193342 is on the candidateCreation line at 16:22:22.275Z and on the delayedConfirmation line at 16:27:24.549Z (same elision; the two lines carry more fields than shown):
16:22:22.275Z stage=candidateCreation decision=created reason=candidateCreated confirmation.updatedAt=1788193342
16:27:24.549Z stage=delayedConfirmation decision=discardCandidate reason=inconsistentResetBoundary confirmation.updatedAt=1788193342
The persisted candidate. File 03 carries a weeklyResetCandidate with evidenceVersion 1, snapshot.dataConfidence exact, snapshot.secondary.usedPercent 0, and createdAt 809889441.32466 (2026-08-31T17:17:21Z). In file 06, candidate reads True on all 15 rows, including on both sides of each of the seven changes in credits.updatedAt. In the poll attached to the 0.56.1 capture, that column read True then False across each change in credits.updatedAt.
Refresh gate. Evidence file 05 is every openai-web refresh-gate line between 16:22:22.282Z and 17:17:22.235Z — 12 lines, all accessEnabled=0 allowed=0 batterySaverEnabled=0 force=0 interaction=background phase=regular.
In the earlier comment the inconsistentResetBoundary outcome was computed rather than logged. These are logged values.
I took no menu-bar capture this round.
Evidence bundle attached.
0.56.2, same run: the withheld weekly value published at 19:22:21.240Z, from a candidate created on the one off-cadence refresh cycle in the span
Continues the 0.56.2 capture:
same build (0.56.2, build 133, CodexGitCommit 29536872a71, Developer ID–signed), same
process run, refreshFrequency = fiveMinutes, one Codex account on prolite. The span of evidence
files 02–04 is 17:17:22.230Z < t < 21:22:23.028Z, contiguous with the previous comment's
span; selection, per-file spans, and timestamp conventions are in the bundle README. Source
citations are to 29536872a71.
What happened. The weekly history row the app carried was
usedPercent: 58, sampledAt: 2026-08-29T17:28:35Z; the next row is
usedPercent: 0, sampledAt: 2026-08-31T19:22:21Z, with no row between (file 06, lines 36–37).
In this span, all 25 stage=delayedConfirmation discards read reason=inconsistentResetBoundary;
the 26th evaluation, at 19:22:21.240Z, read decision=publishCurrent reason=confirmedObservation
and the value published.
Effect on further testing. The account has left the state this issue is about: the persisted
weekly value is 0 with no weeklyResetCandidate key (file 05), and the rendered detail reads
Weekly 100% left (file 09). I cannot produce further live captures of the withheld state.
The decisive comparison
The last discard and the publication, from file 02 (timestamp abbreviated; level tag, subsystem
prefix and message text removed; other fields elided):
19:20:33.303Z discardCandidate inconsistentResetBoundary confirmation.resetBoundary=1788808642 initial.resetBoundary=1788808832
19:22:21.240Z publishCurrent confirmedObservation confirmation.resetBoundary=1788808833 initial.resetBoundary=1788808940
Each raw line carries 46 fields; comparing all 46, exactly six differ — the two boundaries above,
their two updatedAt companions (1788203842/1788204033 vs 1788204034/1788204141), and
decision/reason. Everything else, including previousSnapshot.weeklyUsedPercent=58.000 and
confirmation.creditsAvailableCount=1, is identical on both lines.
The deciding guard is CodexWeeklyResetConfirmation.swift:351-353 with
resetEquivalenceToleranceSeconds = 2 * 60 (:82); its reasons are each returned at exactly one
site (:352, :370). On these log lines initial.* is the current observation and
confirmation.* is the stored candidate — the trace is built with
initialSnapshot: rawInitialSnapshot, confirmationSnapshot: pendingCandidate.snapshot
(UsageStore+CodexWeeklyResetConfirmation.swift:108-117) and written under those prefixes
(:357-358, :361-362). Subtracting the quoted operands: 1788808832 − 1788808642 = 190 (not
less than 120, discard); 1788808940 − 1788808833 = 107 (less than 120, publish).
Across all 25 discards that subtraction gives 299 on 14 lines, 300 on 7, 298 on 3, and 190
on 1. The #3302 comment
left the "120-second boundary tolerance" unchanged and noted "The separately reported
297–301-second rolling-boundary differences can still fail that compatibility check" — 24 of the
25 discards fall inside that reported range. The two values outside it, 190 and 107, both
involve the off-cadence cycle below.
The off-cadence cycle
File 03 holds 51 refresh-gate lines → 50 intervals. Against a 295–305 s band around the
five-minute setting, 48 fall inside; the two that do not adjoin the gate line at 19:20:34.130Z,
and the interval between its bracketing lines (19:17:22.466Z, 19:22:21.264Z) is itself in band
— the surrounding cadence is unbroken. All 51 lines carry phase=regular interaction=background force=0. That cycle's stage=candidateCreation line (19:20:34.123Z) carries
confirmation.resetBoundary=1788808833 / confirmation.updatedAt=1788204034 — the pair the
publication line carries as its confirmation.* values, and the only candidateCreation line in
file 02 carrying it.
Open questions
- What scheduled the cycle at
19:20:33.302Z. Not established. No line in file07names a trigger for it, and its own lines are indistinguishable from the scheduled ones. - The upstream reset is externally timed; this bundle carries no sample between
2026-08-29T17:28:35Zand2026-08-31T19:22:21Z.
Evidence bundle attached; 00-README.md carries spans, conventions, the excluded boundary-adjacent
line, and the redaction statement. No email, account/workspace identifier, username/path,
credential, or raw provider response is included.
0.59.0: published weekly 16.000 against observations of 0.000, and the five delayed evaluations
The decisive pair, from evidence file 01 (timestamp abbreviated; level tag, subsystem prefix
and message text removed; field order changed; other fields elided):
09:15:25.762Z discardCandidate inconsistentResetBoundary confirmation.resetBoundary=1789809026 initial.resetBoundary=1789809325
09:17:05.628Z publishCurrent confirmedObservation confirmation.resetBoundary=1789809326 initial.resetBoundary=1789809425
Each raw line carries 46 fields; comparing all 46, exactly six differ — the two boundaries above,
their two updatedAt companions (1789204226/1789204526 against 1789204526/1789204626),
and decision/reason. The other 40 are identical, including
previousSnapshot.weeklyUsedPercent=16.000, initial.weeklyUsedPercent=0.000,
confirmation.weeklyUsedPercent=0.000, and creditsAvailableCount=3 on previousSnapshot,
initial and confirmation alike.
The deciding guard is CodexWeeklyResetConfirmation.swift:351-353 with
resetEquivalenceToleranceSeconds = 2 * 60 (:82). On these lines initial.* is the current
observation and confirmation.* the stored candidate: the trace is built with
initialSnapshot: rawInitialSnapshot, confirmationSnapshot: pendingCandidate.snapshot
(UsageStore+CodexWeeklyResetConfirmation.swift:101-117) and written under those prefixes
(:356-363). Subtracting the quoted operands: 1789809325 − 1789809026 = 299 (not below 120,
discard); 1789809425 − 1789809326 = 99 (below 120, publish).
One Codex account: file 03 carries a single record. The three admission files are byte-identical between 29536872a71 — the commit of the
0.56.2 capture — and
v0.59.0.
All five delayed evaluations in the capture
| time (Z) | confirmation. resetBoundary |
initial. resetBoundary |
confirmation. updatedAt |
initial. updatedAt |
decision / reason |
|---|---|---|---|---|---|
| 08:10:24.489 | 1789805392 | 1789805424 | 1789200593 | 1789200624 | retainCandidate / minimumDelay |
| 09:05:45.695 | 1789808184 | 1789808744 | 1789203385 | 1789203946 | discardCandidate / inconsistentResetBoundary |
| 09:10:25.761 | 1789808746 | 1789809025 | 1789203947 | 1789204226 | discardCandidate / inconsistentResetBoundary |
| 09:15:25.762 | 1789809026 | 1789809325 | 1789204226 | 1789204526 | discardCandidate / inconsistentResetBoundary |
| 09:17:05.628 | 1789809326 | 1789809425 | 1789204526 | 1789204626 | publishCurrent / confirmedObservation |
initial.weeklyUsedPercent and confirmation.weeklyUsedPercent are 0.000 on all five.
previousSnapshot.weeklyUsedPercent is 16.000 on all 22 lines in file 01 that carry it,
against one previousSnapshot.updatedAt (1789195266) and one previousSnapshot.resetBoundary
(1789467498).
Between rows 1 and 2 the candidate did not survive. File 01 carries, at 08:56:24.413Z,
stage=candidateRetention decision=discardCandidate reason=expiredCandidate, then
stage=candidateCreation decision=created at 08:56:25.092Z (same elision as above: level tag,
subsystem prefix and message text removed, field order changed, other fields elided).
Row 1's outcome turns on a quantity that is not a logged field:
age = observedAt − candidate.createdAt (CodexWeeklyResetConfirmation.swift:310) against
delayedCandidateMinimumAge = 60 (:84) at :369-371. The stage=candidateCreation line
preceding it is at 08:09:53.081Z.
Boundary against observation time on these lines
On all five lines both resetBoundary − updatedAt values fall between 604798 and 604800 seconds
(ledger) — each observation carries a boundary about one week after its own timestamp, so two
observations carry boundaries differing by about the interval between them. The same subtraction on the published
snapshot's own fields, carried on those same lines, is
previousSnapshot.resetBoundary − previousSnapshot.updatedAt = 1789467498 − 1789195266.
What produced the pass at 09:17:05 — not established
It is not on the spacing of the three passes before it (timestamps above). I opened the menu at
about that moment and refreshed an expired Claude OAuth token; that is a self-report. File 05
carries Claude OAuth post-delegation retry failed at 08:56:40.814Z and Claude OAuth credentials loaded for usage at 09:18:15.883Z.
Two paths in v0.59.0 reach a store-wide runRefresh: UsageStore+ResetBoundaryRefresh.swift:45-53,
scheduled from a window's resetsAt + 30 s (:125, constant at UsageStore.swift:139) when that
falls before the next normal refresh (:127), with candidates taken from every provider's snapshot
and every window on it (:103-113, :143-146), re-evaluated after each refresh that passes
guard completedRefresh (UsageStore.swift:856-859); and StatusItemController+MenuInteractionRefresh.swift:158-162,
250 ms (:6) after the menu closes (scheduled from the close handler at
StatusItemController+Menu.swift:212), for providers marked at open by needsUsageRefreshRetry
(:1166-1171), a predicate that is
isStale || !hasSatisfiedUsageFetch (UsageStore.swift:676-678, :689-691). Which one ran is not established; the 46 field names carried on the delayed lines are listed in
the ledger, and none of them names a trigger.
Limits
Not captured: any copy of the persisted record while this state was live — the published values
above are the previousSnapshot.* fields on the log lines; anything about what the menu bar
rendered; and the upstream reset itself, which is externally timed. File 03 is a read at the
capture instant with snapshot.updatedAt 810897496.905711 = 2026-09-12T09:18:16Z, so it is the
state after a refresh later than the publication: usedPercent 0, secondary.resetsAt
2026-09-19T09:18:16Z, and no weeklyResetCandidate key.
Cannot be re-captured: the account has left this state.
Spacings: file 04 covers 04:00Z–09:30Z and records maintenance sleep with DarkWakes up to a wake
at 09:05:43Z. Row 1 falls inside a DarkWake; the other four rows follow that wake. The intervals between the
rows above are the ones observed, not a cadence.
Whether the off-cadence pass in the 0.56.2 capture had the same cause is not established.
Bundle attached: 00-README.md (manifest, hashes, per-file spans, timestamp conventions,
redaction statement), 01 every codex-weekly-reset-publication line in the log (383), 02 the
day's refresh-gate lines, 03 the persisted record, 04 the power log, 05 the Claude OAuth
lines, 06-ledger.md (the command and output behind every quantity above). No e-mail address,
account or workspace identifier, credential, local username or path, or raw provider response is
included.
The remaining rolling-boundary failure is fixed in #3851. Thanks @kcharlan: the later diagnostic captures identify why normal five-minute refreshes discarded candidates while closer observations could publish. Delayed confirmation now recognizes repeated unused seven-day windows whose reset dates advance with capture time, while retaining exact-source, account, plan, credit, age, and timestamp checks. The synthetic decision and file-backed usage→credits→relaunch regressions failed against the baseline evaluator and pass with the fix. All 417 focused tests, repository checks, and isolated review passed. #3302’s candidate-preservation fix remains intact; no credit-expiry comparison was changed. This addresses the later reproduced admission failure without asserting an unproven cause for the original August 27 capture.