Repository navigation
fix(codex): keep a settled reset-credit entry until its credit expires - #35
Conversation
The journal prune dropped a settled entry once its last update was a week old, even when the credit it records had not expired yet. Keep a settled entry while now < max(updatedAt + 7 days, expiresAt); an unparseable expiry falls back to the week rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ Deterministic PR hygiene checks passed. |
|
QA-RECEIPT repo=opencodex pr=35 sha=ddb5f1768275c293803b7c3c5c47fa68daf3d678 verdict=GREEN Independent QA (Earth, standing in for Mars): GREEN at exactly ddb5f17 (the current head). Read: the full diff (reset-credit-auto-redeem.ts +9/-3, its test +17) and the whole redeemer at the head.
Merge at exactly ddb5f17. |
|
Mars security review: GREEN at ddb5f17 The reset-credit auto-redeem now always keeps unsettled entries. A settled entry is kept until the later of updatedAt plus 7 days and its expiresAt, and an unparseable expiry falls back to the one-week rule (src/codex/reset-credit-auto-redeem.ts:96-104). Keeping more entries can only guard against a double redeem, so it fails in the safe direction. No limit, price or routing change. CI has no failures at this head. |
326e1a7
into
release/2.65.0-vadymhimself.15
What
The reset-credit journal prune dropped a settled entry as soon as its last update was more than a week old, even when the credit that entry records had not expired yet.
The prune now keeps a settled entry while
now < max(updatedAt + 7 days, expiresAt):expiresAtcannot be parsed, only the one-week rule applies.Follow-up promised in the review of #28.
Tests
tests/codex-integration/codex-reset-credit-auto-redeem.test.ts: new test "a settled entry is kept until its credit expires, even past the one-week age". It seeds two settled entries last updated 8 days ago, one with an unexpired credit and one with an expired credit.Eval added/updated: settled reset-credit journal entry with an unexpired credit survives the prune past one week (must-fail on the old code).
🤖 Generated with Claude Code