Skip to content

fix(proxy): allow verified replay past dead owner route - #1604

Closed
jaekwonhong wants to merge 2 commits into
Soju06:fix/dead-account-proxy-route-failoverfrom
jaekwonhong:codex/pr-1542-initial-replay-fix
Closed

fix(proxy): allow verified replay past dead owner route#1604
jaekwonhong wants to merge 2 commits into
Soju06:fix/dead-account-proxy-route-failoverfrom
jaekwonhong:codex/pr-1542-initial-replay-fix

Conversation

@jaekwonhong

Copy link
Copy Markdown

Summary

Addresses the current-head Codex P2 on #1542.

  • Allow a locally verified complete fresh replay to drop a dead previous-response owner anchor after the initial confirmed pre-dispatch proxy connection failure.
  • Preserve fail-closed behavior for file, turn-state, single-account, other required ownership, exhausted attempts, and downstream-visible output.
  • Reuse the existing owner-replay helper and update the OpenSpec ownership contract.

Validation

  • 17 passed: verified fresh replay / confirmed proxy-connect failure / ambiguous-dispatch unit regressions
  • 1 passed: Responses integration failover regression
  • Ruff check and format check passed
  • openspec validate retry-account-proxy-connect-failures --strict passed
  • openspec validate --specs --strict: 49 passed

Review context

Addresses unresolved thread PRRT_kwDOQ1HZ7s6WlLSJ on #1542. This PR intentionally targets the feature branch so the fix can be absorbed without widening the original PR.

@jaekwonhong

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58b474fe84

ℹ️ 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".

This behavior MUST cover raw HTTP/SSE, native Responses WebSocket, and the HTTP responses bridge. Before recording transient account backoff, the service MUST release response-create and stream leases held for the failed account. A request-scoped API-key reservation MUST remain singular across an internal pre-dispatch failover, MUST settle or release at the terminal request outcome before the account-health write, and MUST NOT be reacquired solely for the internal failover. If neither settlement nor fallback release can be confirmed, the service MUST leave the health write unapplied. HTTP-bridge startup cleanup MUST release only an unowned current request lifecycle, and each reservation lifecycle MUST drain only its own health writes after confirmed settlement or release. The confirmed failure MUST place the account at the existing bounded transient error-backoff floor, but MUST NOT pause, deactivate, rate-limit, or quota-penalize it.

The service MUST NOT replay a request when dispatch is unknown or when the request depends on hard previous-response, turn-state, uploaded-file, single-account, or other required account ownership. If no eligible replacement account exists, the service MUST preserve the original sanitized upstream-unavailable failure instead of replacing it with a generated `no_accounts` error.
When local continuity evidence verifies that a previous-response continuation contains a complete fresh replay which can be resent without its owner anchor, a confirmed pre-dispatch failure on that owner MUST remove the anchor and retry another eligible account. This exception MUST NOT apply when the request also depends on turn-state, uploaded-file, single-account, or other required account ownership, or after any output becomes downstream-visible.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Implement replay on every scoped transport

Because this new MUST is in the same requirement that says confirmed pre-dispatch failover covers raw HTTP/SSE, native Responses WebSocket, and the HTTP bridge, it now promises verified-owner replay for those transports too. I checked the other transport paths: native WS still returns surface for confirmed pre-dispatch errors whenever require_preferred_account is true (app/modules/proxy/_service/websocket/mixin.py:3194-3195), and bridge startup still raises immediately for a required account (app/modules/proxy/_service/http_bridge/proxy_failover.py:52-53), so a verified fresh replay on either path still fails closed instead of removing the anchor and retrying. Please either implement the same anchor-clearing path there or narrow this spec to the HTTP/SSE path that changed.

AGENTS.md reference: AGENTS.md:L24-L27

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: e2a65b2a2f

ℹ️ 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".

@jaekwonhong

Copy link
Copy Markdown
Author

Closing this stacked PR because the repository owner has directed all further publication to XZ-Organization/Codex_Model-provider-selector_codex-lb only.

@jaekwonhong jaekwonhong closed this Aug 5, 2026
@jaekwonhong
jaekwonhong deleted the codex/pr-1542-initial-replay-fix branch August 5, 2026 09:15
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.

1 participant