Skip to content

fix(proxy): recover anchored bridge requests after missing response.created - #1736

Open
kevinsslin wants to merge 2 commits into
Soju06:mainfrom
kevinsslin:codex/fix-precreated-response-created-recovery
Open

fix(proxy): recover anchored bridge requests after missing response.created#1736
kevinsslin wants to merge 2 commits into
Soju06:mainfrom
kevinsslin:codex/fix-precreated-response-created-recovery

Conversation

@kevinsslin

Copy link
Copy Markdown

Summary

  • recover one hard-owner HTTP Responses continuation when the upstream accepts response.create but never emits response.created;
  • reconnect on the same account and resend the unchanged previous_response_id anchor once, before any response/model/downstream output exists;
  • keep the existing fail-closed behavior for soft affinity, file-pinned requests, visible/eventful requests, and subsequent failures;
  • keep this watchdog recovery budget separate from replay_count, and bypass retry-circuit cooldown only for the narrowly proven eventless same-anchor attempt.

Fixes #1735

Related: #1393, #1394, #1711, #1723.

Why

Stable 1.23.0 still leaves an anchored continuation at the eventless watchdog boundary:

Upstream did not acknowledge response.create before the client-safe deadline
missing_response_created_timeout

The existing generic replay guard correctly rejects ambiguous anchored replays, but it also rejected this narrower state where no upstream response event, model output, or downstream-visible output exists. The request then terminally 502s and the Codex client spends its reconnect budget / pauses the task.

Safety boundary

The new path is opt-in only from the missing-response.created watchdog and requires:

  • hard bridge ownership;
  • an existing previous_response_id and no assigned response ID;
  • awaiting response.created with zero response events;
  • no downstream sequence/visible output or upstream model output;
  • no account-scoped file requirement;
  • at most one watchdog-owned same-anchor attempt.

A replacement socket that is also silent is terminally retired; recovery is not indefinite. Durable operation fencing, account ownership, admission, API-key reservations, and direct WebSocket behavior are unchanged.

OpenSpec

openspec/changes/recover-precreated-anchored-bridge/

Validation

  • uv run pytest -q tests/integration/test_http_responses_bridge.py — 129 passed
  • uv run pytest -q tests/unit/test_proxy_http_bridge.py — 551 passed
  • uv run ruff check app tests — passed
  • uv run ruff format --check app tests — passed
  • uv run ty check — passed
  • uv run python scripts/check_proxy_architecture.py — passed
  • npx --yes @fission-ai/openspec@1.9.0 validate recover-precreated-anchored-bridge --strict — valid
  • npx --yes @fission-ai/openspec@1.9.0 validate --specs — 57 passed, 0 failed
  • git diff --check — passed

No database, environment, public API, or dependency changes. This PR is committed at 1858d95b and pushed, but it is not merged, deployed, or live-verified yet.

kevinsslin added a commit to kevinsslin/codex-lb that referenced this pull request Aug 14, 2026
Integrates the reviewed transport reliability fixes from upstream PRs Soju06#1723, Soju06#1726, and Soju06#1736 into the production fork main after combined local validation.
@kevinsslin
kevinsslin marked this pull request as ready for review August 14, 2026 08:59

@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: 1858d95b5b

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

Comment thread app/modules/proxy/_service/http_bridge/request_submit.py Outdated
Comment thread app/modules/proxy/_service/http_bridge/upstream_events.py Outdated
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
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.

fix(proxy): recover anchored HTTP bridge turns after silent response.create

2 participants