fix(proxy): retry detached API key release - #1545
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c77b1feb95
ℹ️ 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. Bravo. 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". |
|
Triage review passed (verified the tracked-retry semantics and the one-shot inline backstop) and this was queued for merge today, but #1558 landed first and touches the same settlement region, so the branch flipped to conflicting. One rebase over current main and this merges immediately — the review stands, no re-review needed unless conflict resolution changes the retry/semaphore logic. |
|
@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". |
Summary
A detached stream API-key settlement could fail, enqueue its reservation-release fallback, and then lose that cleanup if the fallback also hit a transient persistence error. The persistence drain could consequently report success while the reservation continued consuming quota until stale recovery.
This change keeps the tracked fallback alive and retries the idempotent release with capped exponential backoff. A shared four-attempt gate bounds aggregate repository pressure, and
drain_persistence_tasks()cannot report completion while that settlement/release chain remains unfinished.Type of change
fix:— bug fix (no behavior change beyond the bug)Linked issue: None — no matching issue was found.
OpenSpec
Change directory:
openspec/changes/retry-detached-api-key-release/This does not change any upstream request or response wire format.
Changes
Related work
Test plan
3fe0d6f286019a0505783d803db9a1d8cdf6b307and passes with this fix.Screenshots / output
Not applicable — no dashboard, rendered UI, media, request schema, or response schema changes.
Checklist
CHANGELOG.mdis not edited.