fix(quota): release reservations on header failure - #1559
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de477242d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Now CONFLICTING with main, but the conflicts are confined to the bridge-lifecycle commits: Suggest splitting: land the quota fix as-is, and rebase the six bridge close-ownership commits separately. That rebase is not mechanical — #1394 reworked reader retirement/handoff and clean-close reuse on the same paths, so the exact-once One scope note so nobody assumes broader coverage: this releases the reservation for failures in the admission→header window only. The post-completed-event leak in #1594 (aborted completed bookkeeping strands the reservation heartbeat because |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Close the ownership gap after API-key quota admission commits a reservation but before route-specific settlement owns cleanup. If rate-limit response-header calculation fails, the proxy now releases only the locally owned reservation through cancellation, propagates the original header failure, and does not start upstream work.
This PR is intentionally quota-only. The HTTP bridge lifecycle work has been removed and will be handled separately. The post-completed-event leak tracked in #1594 is a different lifecycle stage and remains open.
Type of change
fix:— bug fix (no behavior change beyond the bug)feat:— new user-facing feature or capabilityrefactor:— internal refactor (no behavior change, no API change)docs:— documentation onlychore:/ci:/build:— tooling, CI, packagingtest:— test-only changeLinked issue: None found in the bounded upstream issue/PR search. #1594 is related but explicitly outside this PR's lifecycle stage and remains open.
OpenSpec
Change directory:
openspec/changes/release-quota-reservations-on-header-failure/The change is quota-only and defines admission-to-header reservation cleanup across stream, collect, compact, and subscription-backed transcription requests. It introduces no API, schema, setting, dashboard, default, or successful-response contract change.
Changes
Test plan
No local PostgreSQL server was used, so the asyncpg variant was not run locally. The parameterized regression remains included in
POSTGRES_PYTEST_TARGETSfor the required PostgreSQL CI job.Screenshots / output
Not applicable: this changes an internal proxy failure path and has no dashboard or successful-response surface change. Route-level regressions cover the externally relevant seam.
Checklist
<type>(<scope>)?: <subject>).openspec validate --specspasses and the scoped change verifies cleanly.