Conversation
…fallback gate, transient retry
Collaborator
Author
|
Thermo-nuclear review Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude Findings (1):
Disposition: not applied. Running both paginated fetches concurrently doubles the request burst against the rate-limited Admin API, which this PR already guards with transient retry; the latency gain is marginal for a background refresh. No other defects found against the 0.66.0 openai-admin-parity spec. No code changes needed; no commit pushed. |
Collaborator
Author
|
Validated 2026-10-02 at 44dada5 (PR head):
Chain note: base for #699 (per-day usage core) and #701 (chart UI). Proceeding to #699's CI diagnosis next. |
Finesssee
added a commit
that referenced
this pull request
Oct 2, 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.
Summary
OpenAI Admin usage (
rust/src/providers/openaiapi/mod.rs) now matches upstream v0.66.0openai.js/ nativeOpenAIAPIUsageFetcherbehavior:/v1/organization/costs(group_by=line_item) and/v1/organization/usage/completions(group_by=model) usebucket_width=1d,limit <= 31and UTC-day-aligned 31-day ranges, followinghas_more/next_page(100-page cap per range; a missing, blank or repeated cursor is a parse error). A busy org is no longer silently truncated.input + input_audio + output + output_audio. Cached input is a subset of input and is no longer added on top (it was double counted in the Tokens row and model ranking).billing-apilabel andAPI balancelogin method.Retry-Afteris honored up to 10 s, default 1 s. Auth failures and other transport errors are never retried. Request timeout is 20 s as upstream.tests.rs(mod.rs stays under 1000 lines).Upstream reference
a634f55c; native behavior from v0.65.0OpenAIAPIUsageFetcher.swift).v0.66.0:Sources/CodexBarCore/Resources/Plugins/openai.js(ranges,pages,queryURL, tokens),Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift(OpenAIAPIUsageCredential.allowsLegacyBalanceFallback), testsOpenAIAPIUsageFetcherTests,OpenAIAPIProjectScopeTests.Ported / Deferred
Ported: pagination, UTC day ranges, token totals, balance-fallback gate, transient retry.
Deferred:
OPENAI_HISTORY_DAYS(1-365): there is no Windows setting for it, so the window stays 30 days and the label staysLast 30 days.usage_rangesalready takes the day count, so wiring a setting later is a one-line change. Documented in the module header.card.openAIAPIUsage): separate UI decision, no Windows chart counterpart.now(upstream ends at tomorrow's midnight) because the API rejects a futureend_time.Validation
All on the pinned toolchain
cargo +1.98.0, E-core wrappers, slot-3.cargo +1.98.0 fmt --all: clean.cargo +1.98.0 clippy -p codexbar --all-targets -- -D warnings: pass.cargo +1.98.0 test -p codexbar openaiapi -- --test-threads=4: 29 passed, 0 failed (6 pre-existing tests kept, 23 new: pagination cursors, missing/repeated cursor, 100-page cap, long-history ranges, token totals, fallback gate matrix, retry policy, retry once then report status, no retry for auth).codexbar-desktop-tauribuild script fails in slot-3 on a stale tauri permissions path from another slot's cache (environmental). This PR does not touch that crate.Affected areas
UI proof
Not applicable (Tokens/Requests row values change; no UI code touched).