Repository navigation
Show when usage credits expire - #1100
Merged
Merged
Conversation
OpenAI reports no usage-credit expiry, so Chris enters the day once per provider in Settings. The app and agent snapshot show it beside the balance, count credits at risk of expiring unspent, and count the balance left at the expiry in the weekly waste number. A provider-reported expiry wins.
Contributor
Author
|
Ready for the merge train Head: cf5abd6 |
Contributor
Author
|
Launchplane completed the merge-train step for this pull request.
Launchplane finished the merge-train step for this pull request. Launchplane manages this comment and will update it as the train moves. |
shiny-code-app Bot
added a commit
that referenced
this pull request
Nov 9, 2026
…-97fb5c00c272c206: merge PR #1100
This was referenced Nov 9, 2026
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.
Why
OpenAI granted about 60,000 usage credits per account that expire at the end of December 2026. Context Panel showed the balance but no deadline, so nothing said whether the credits will be wasted. The weekly waste number could not count them either.
What OpenAI reports
No usage-credit expiry anywhere Context Panel reads.
creditsobject hashas_credits,unlimitedandbalance. Codex's own backend schema (codex-backend-openapi-models,CreditStatusDetails) adds only message estimates. No date.creditsobjects across this Mac's Codex homes all have exactly those three keys. Only key names were read.rate-limit-reset-creditssibling hasexpires_at, but for banked resets, not usage credits. It is already used for those.So the date comes from Settings.
What changed
usageCreditExpiries, per provider. All three grants share one date, so per provider is the simpler fit. No date is hardcoded.expiresAt, that is used instead, and the source says so.providers[].unusedAtPacegainsusageCreditsExpireAt,usageCreditsExpirySource(providerorentered) andusageCreditsAtRisk. At risk is every credit left while no account is at 0%. It is null while an account is spending them, because one reading can't say how many will be left. All three are null when no future expiry is known.usageCreditsExpiredUnusedthat week. The entered day is saved as its start, so credits left when Dec 31 begins count. This no longer subtracts the balance after the expiry, so a new grant cannot hide expired credits.docs/provider-usage-access.md.Closes #1099
Verification
swift build: clean (only existingsaveAccounts()warnings).swift test --filter ContextPanelCoreTests: 1366 passed.Removed: the balance-after subtraction at a credit expiry, and the fixed "expiry not reported" label.
Net lines: Sources +133, Tests +98, docs +15.