Skip to content

[PR] fix: isolate Google query-key throttle holds - #7187

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-18_isolate-google-query-key-holds
Nov 20, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-18_isolate-google-query-key-holds

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Fixes #7186.

Problem

Google native requests can authenticate with a key or $key query parameter. The 429 governor fingerprints only credential headers, so independent query-authenticated accounts on the same supplier host share one anonymous hold. A 429 for account A prevents account B from reaching its available provider quota, including the pre-ingest gate for large requests.

Change

Extend the shared hold-key helper for native Google model RPC paths. When no effective recognized credential header exists, an unambiguous non-empty query key uses the existing credential fingerprint. The same key in the query or Google header therefore identifies the same account.

Existing header identities and mixed header/query behavior remain unchanged. Conflicting repeated values, unrelated parameters, and non-Google route forms retain their previous handling. No raw query credential is stored in a hold or added to diagnostics. No configuration, kernel, or model-visible text changes.

Validation

  • Initial untouched baseline: three new failures (public governor API and two actual HTTP paths); all 41 existing governor and multi-header identity tests passed.
  • Expanded new regressions before the change: 13 failed / 11 passed. They cover the three RPC methods, both query aliases, URL decoding, header/query identity, duplicate/conflicting values, independent success, and terminal holds.
  • Final targeted run: 86 passed, covering the new file plus governor, credential-set, early-hold, and model-scope tests.
  • Actual startServer requests against a controlled local HTTP supplier now observe A → upstream 429, B → upstream 200, A retry → local 429. Both small and >1 MiB requests are exercised.
  • npm run typecheck, npm run build, npm run check:test-import-graph, and git diff HEAD^ --check passed. Worktree-local kernel and pi-subagents builds match base 3f0c1d21.
  • Independent source and regression review found no blocker.

Real Codex preflight found the CLI and built proxy, but the configured upstream on port 8199 is unreachable. The real-model four-phase run has not run and remains required before merge; a skipped CI job is not evidence that this gate passed. Full-suite verification belongs to remote CI.

Duplicate screening

Checked all 268 pre-existing fork heads, 66 throttle-file and 742 ledger-file upstream history commits, and the actual changes in #2150, #4235, #6154, #5207, #5696, and #5905. None implements query-key hold identity.

@ranxianglei ranxianglei changed the title fix: isolate Google query-key throttle holds [PR] fix: isolate Google query-key throttle holds Nov 18, 2026
@ranxianglei
ranxianglei merged commit bb797c0 into ranxianglei:master Nov 20, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google query API keys incorrectly share the same 429 hold

2 participants