fix(proxy): sequence websocket health after settlement - #1558
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef0d53702b
ℹ️ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4daa0cf8d
ℹ️ 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. You're on a roll. 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". |
|
Traced the three touched paths against main; the invariant violation is real and the fix holds up.
Overlap note: #1546 (closed) contained this core fix; this PR is the surviving isolated version. #1545 touches the same api_key_usage.py region — content-compatible, but whichever merges second needs a rebase. Adjacent to #1594 (heartbeat leak on aborted paths that never reach this finalizer) without conflicting. #1550's websocket/mixin.py hunks (~1017, ~4636) are disjoint from the finalizer region here — the two compose. Fix-class, MERGEABLE, CI fully green, OpenSpec delta validates. Merge-ready. |
Summary
Ensure ordering-sensitive stream callers observe whether API-key usage settlement actually committed before writing account health. A failed primary settlement now completes fallback release under the same tracked task once started; pre-start cancellation transfers release to the tracked callback instead. Cancellation during started work reports an unconfirmed outcome only after the release attempt completes. If neither operation confirms settlement, the related WebSocket or deferred retry health write remains unapplied.
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: Related to #1314
OpenSpec
Change directory:
openspec/changes/sequence-websocket-health-after-settlement/Changes
Related work
main.Test plan
Full local CI was not run; the focused Sensitive checks above cover the changed seam, and required GitHub CI remains the integration gate.
Checklist
<type>(<scope>)?: <subject>).openspec validate --specspasses and the change verification is clean..env.example, dashboard navigation, or default changed.