Repository navigation
fix: carry account recovery, server-tool buffer, and usage corrections #7236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9c0ca63
638d157
b2c6308
1b241ea
46117b3
b158e8c
9636659
9f2de49
367b12a
97bc224
069c1da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -975,8 +975,8 @@ export async function retryCodexPoolOnAlternateAccount( | |
| const maxRetrySends = retrySameConfirmedAccount ? 7 : 1; | ||
| let retrySendCount = 0; | ||
| // The gated-model 400 has no roster kind; it stays unattributed as before. | ||
| const moveRecovery: AttemptRecoveryKind | undefined = outcomeStatus === 429 || outcomeStatus === 402 | ||
| ? "oauth-account-429" | ||
| const moveRecovery: AttemptRecoveryKind | undefined = outcomeStatus === 429 ? "oauth-account-429" | ||
| : outcomeStatus === 402 ? "oauth-account-402" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This changes Codex HTTP 402 moves to AGENTS.md reference: src/AGENTS.md:L11-L11 Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| : isTransientUpstreamStatus(outcomeStatus) ? "transient-5xx" : undefined; | ||
| let upstreamResponse: Response; | ||
| try { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -665,8 +665,12 @@ function addEstimatedCost( | |
| entry: Pick<PersistedUsageEntry, "usageStatus" | "usage" | "attempts">, | ||
| costInfo: EntryCostInfo, | ||
| ): void { | ||
| if (entry.usageStatus === "unreported" || entry.usageStatus === "unsupported" | ||
| || (!entry.usage && !entry.attempts?.length)) { | ||
| // A row of attempts reads `unreported` when any leg lacks usage. Once one leg is measured the row | ||
| // is metered and the attempt-level pricing decides, matching the model and provider breakdowns. | ||
| const measuredAttempt = entry.attempts?.some(attempt => attempt.usage && isMeasuredStatus(attempt.usageStatus)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a successful request has an unreported pre-output refusal followed by a measured send, this branch now prices it in Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed on source PR #7233 in 52b623b (routing analytics successCostUsd now reuses computeEntryCost, so a usage-less 429 before a measured send is priced in /api/routing-analytics as in /api/usage; test: tests/routing/routing-analytics.test.ts "a refused retry before a measured send is priced, matching /api/usage"), ready to cherry-pick. |
||
| if (!measuredAttempt | ||
| && (entry.usageStatus === "unreported" || entry.usageStatus === "unsupported" | ||
| || (!entry.usage && !entry.attempts?.length))) { | ||
| totals.unmeteredRequests += 1; | ||
| return; | ||
| } | ||
|
|
@@ -822,7 +826,9 @@ function blankRequestCounts(): UsageRequestCounts { | |
| function spentNothing(attempt: NonNullable<PersistedUsageEntry["attempts"]>[number] | undefined): boolean { | ||
| if (!attempt || attempt.usage) return false; | ||
| if (attempt.sendCount === 0 || attempt.locallyAnswered === true) return true; | ||
| return attempt.status >= 400 && attempt.streamAborted !== true && attempt.firstOutputMs === undefined; | ||
| // A 499 is the client hanging up on a send upstream may already be generating for. | ||
| return attempt.status >= 400 && attempt.status !== 499 | ||
| && attempt.streamAborted !== true && attempt.firstOutputMs === undefined; | ||
| } | ||
|
|
||
| function bumpRequestCounts(counts: UsageRequestCounts, facts: number, amount = 1): void { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 3925
Run the required GUI build before completion.
The reported validation status says that builds were not run. This change is under
gui/**, so runcd gui && bun run buildbefore marking it complete.🤖 Prompt for AI Agents
Source: Coding guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GUI build on source PR #7231 at 9ea4be7:
cd gui && bun run build(tsc -b && vite build) exits 0 and builds clean; only the pre-existing >500 kB chunk-size warning. Added to #7231 Verification.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vadymhimself Thanks for the verification details. The successful build at
9ea4be7a6confirms source PR#7231builds, with only the pre-existing chunk-size warning.That does not confirm the combined state in
#7236, so this PR’s GUI build remains unverified. No change to the French translation is needed.You are interacting with an AI system.