fix(codex): preserve usage data and show refresh failures - #208
Merged
Merged
Conversation
Member
Author
|
The initial PR check failed in the unrelated updater test |
Member
Author
|
The failed job passed on rerun without code changes: https://github.com/contember/okena/actions/runs/35606308593 . Linux checks/tests, Windows compilation, and mobile checks are now green. The original updater-test failure remains unexplained; it did not reproduce locally or on this rerun. |
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
okena/<version>User-Agent on Codex usage, reset-credit, and token-refresh requests. Usage requests also advertiseAccept: application/json.Context
An API failure could previously replace current usage with a days-old local session snapshot, causing percentages to jump. That fallback also counted as a successful fetch. Diagnostics now distinguish a fresh API snapshot from a failed refresh.
Live requests with the same credentials returned Cloudflare challenges with an absent/Python User-Agent and JSON with the Okena User-Agent. The shared HTTP client already sets an Okena User-Agent on main; this change makes that requirement explicit at the Codex request sites. It does not establish that headers alone explain every observed 403.
Verification
cargo test -p okena-ext-codex: 8 tests passed.cargo clippy -p okena-ext-codex --all-targets --no-deps: passed; the dependencyokena-transportemits an existing unusedaction_urlwarning.git diff --check: passed.