Repository navigation
fix(combos): a spent pool account must not cool the whole target (carry #6234) #6255
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
3ea6432
e811a63
c686e1b
b3a7768
2f77377
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 |
|---|---|---|
|
|
@@ -46,6 +46,11 @@ import { | |
| import { hasUnreadableEncryptedAgentTask } from "./encrypted-payload"; | ||
| import { routeConcreteModel, comboRouteDecisionTrace } from "../../router"; | ||
| import { memoryModelRouteReason } from "./memory-models"; | ||
| import { poolAccountProviderLabel } from "../../providers/label"; | ||
| import { getAccountSet } from "../../oauth/store"; | ||
| import { formatAnthropicProviderForLog, getAnthropicAccountHealthSnapshot } from "../../oauth/anthropic-routing"; | ||
| import { codexAccountLogLabel } from "../../codex/account-label"; | ||
| import { codexQuotaScopeForModel, getCodexQuotaHealthSnapshot } from "../../codex/routing"; | ||
| import { isCanonicalOpenAiForwardProvider } from "../../providers/openai-tiers"; | ||
| import type { AgentTaskRecoveryFailureReason } from "./agent-task-recovery"; | ||
| import { | ||
|
|
@@ -97,6 +102,22 @@ import { clientWireOf } from "../inference/client-wire"; | |
| */ | ||
| export const COMBO_TARGET_BASE_SENDS = CODEX_TEXT_GUARDED_BUDGET_POLICY.baseSendAllowance; | ||
|
|
||
| function cooledPoolAccountLabel(config: OcxConfig, providerName: string, modelId: string, label: string | undefined): string | undefined { | ||
| if (!label) return undefined; | ||
| if (providerName === "anthropic") { | ||
| const matches = getAccountSet("anthropic")?.accounts.filter(account => | ||
| formatAnthropicProviderForLog("anthropic", account.id) === label) ?? []; | ||
| return matches.length === 1 && getAnthropicAccountHealthSnapshot(matches[0]!.id) ? label : undefined; | ||
| } | ||
| const provider = config.providers[providerName]; | ||
| if (!provider || !isCanonicalOpenAiForwardProvider(provider)) return undefined; | ||
| const matches = (config.codexAccounts ?? []).filter(account => | ||
| `${providerName}-${codexAccountLogLabel(account)}` === label); | ||
| return matches.length === 1 | ||
| && getCodexQuotaHealthSnapshot(matches[0]!.id, codexQuotaScopeForModel(modelId)) | ||
| ? label : undefined; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * A combo's execution policy is DECLARED by the combo, not inherited from the single-target | ||
|
|
@@ -977,6 +998,13 @@ export async function executeComboResponses( | |
| status: failure.response.status, | ||
| code: failure.upstreamCode, | ||
| message: failure.classificationText, | ||
| // The dispatch rewrote this to name the pool account that actually served the turn. | ||
| failedAccount: cooledPoolAccountLabel( | ||
| config, | ||
| pick.target.provider, | ||
| pick.target.model, | ||
| poolAccountProviderLabel(childLog.provider, pick.target.provider), | ||
|
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 canonical Codex pool dispatch uses the Useful? React with 👍 / 👎. |
||
| ), | ||
| onCooldownRecorded: target => { | ||
| failedTargetCooldownRecorded ||= targetKey(target) === failedTargetKey; | ||
| }, | ||
|
|
||
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.
For an Anthropic combo using a web-search or image sidecar,
sidecar-execution.ts:262-306returns a terminal 429 without callingrecordAnthropicAccount429when the shared hop reservation is denied or the three-failover cap has already been reached. The current account consequently has no health snapshot here, so a five-account pool that exhausts the fourth account cools the whole combo target and blocks the untouched fifth account. Apply the same terminal-429 recorder added to the dispatch and continuation loops before these sidecar returns.Useful? React with 👍 / 👎.