Skip to content

fix(proxy): keep file-pin owner on soft 1011 reconnect - #1761

Merged
Komzpa merged 8 commits into
Soju06:mainfrom
mastertyko:fix/soft-file-pin-1011-reconnect
Aug 15, 2026
Merged

fix(proxy): keep file-pin owner on soft 1011 reconnect#1761
Komzpa merged 8 commits into
Soju06:mainfrom
mastertyko:fix/soft-file-pin-1011-reconnect

Conversation

@mastertyko

Copy link
Copy Markdown
Contributor

Summary

A live input_file.file_id pin is hard ownership. Soft HTTP-bridge reconnect after upstream 1011 treated that owner as skippable prompt-cache locality, so submit-on-closed recovery could send the file to another account.

Type of change

  • fix: — bug fix (no behavior change beyond the bug)

Linked issue: none — discovered on current main; adjacent to #1521 (cross-replica pin persistence), not a duplicate.

OpenSpec

  • This PR includes / updates an OpenSpec change
  • This PR touches a codex-faithful path (image pipeline, request/response
    shape, SSE framing, OAuth flow) and preserves upstream-equivalent behavior

Change directory: openspec/changes/keep-file-pin-owner-on-soft-1011-reconnect/

Changes

  • _reconnect_http_bridge_session treats file_required_preferred_account as a required owner (falls back to the current session account if preferred_account_id is missing).
  • _retry_http_bridge_request_on_fresh_upstream now passes require_preferred_account when a live file pin is present.
  • Soft 1011 reconnects without a file pin still skip the closed account.
  • Unit coverage for keep-owner, skip-without-pin, and the fresh-upstream call shape.

Test plan

uv run pytest \
  tests/unit/test_proxy_http_bridge.py::test_reconnect_http_bridge_session_preserves_hard_account_after_1011 \
  tests/unit/test_proxy_http_bridge.py::test_reconnect_http_bridge_session_keeps_soft_file_pin_owner_after_1011 \
  tests/unit/test_proxy_http_bridge.py::test_reconnect_http_bridge_session_skips_soft_account_after_1011_without_file_pin \
  tests/unit/test_proxy_http_bridge.py::test_retry_http_bridge_request_on_fresh_upstream_reconnects_without_resending_previous_response_id \
  tests/unit/test_proxy_http_bridge.py::test_retry_http_bridge_request_on_fresh_upstream_requires_file_pin_owner \
  tests/unit/test_proxy_http_bridge.py::test_reconnect_http_bridge_session_fails_closed_when_bound_account_is_excluded \
  tests/unit/test_proxy_http_bridge.py::test_reconnect_http_bridge_session_ignores_stale_preferred_account_after_1011 \
  -q
# 7 passed
openspec validate keep-file-pin-owner-on-soft-1011-reconnect --strict
# valid

Full local CI not run. GitHub required CI is the integration gate.

Related work

Checklist

  • Title is in Conventional Commits format (<type>(<scope>)?: <subject>).
  • Added or updated tests covering the change.
  • Ran the focused reconnect unit tests and strict OpenSpec validation for this change.
  • CHANGELOG is not edited by hand (release-please handles it).
  • No new setting, README section, or dashboard nav item.

A live input_file pin is hard ownership. Soft HTTP-bridge reconnect after
upstream 1011 was treating that owner as skippable prompt-cache locality.
@mastertyko

Copy link
Copy Markdown
Contributor 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: 117a475aa2

ℹ️ 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
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
Move reconnect owner resolution out of mixin.py so the architecture
check stays green, and update the remaining fresh-upstream call-shape
assertion.
@mastertyko

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 3a7b04f1e6

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

Fresh-upstream retry swallowed the required-owner envelope and the
submit-on-closed path replaced it with generic upstream_unavailable.
@mastertyko

Copy link
Copy Markdown
Contributor 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: 6234fb98fa

ℹ️ 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
Terminal reconnect selection failures (no_accounts, preferred miss,
local cap) were still emitted as generic selection errors even when a
live file pin made the owner required.
@mastertyko

Copy link
Copy Markdown
Contributor Author

@codex review

@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026

@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: 65a634d888

ℹ️ 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
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
Precreated retry already fail-closes when the required file owner
cannot be selected; the envelope is now previous_response_owner_unavailable.
@mastertyko

Copy link
Copy Markdown
Contributor 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: 6230c97b9d

ℹ️ 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 tests/unit/test_proxy_http_bridge.py
Selecting the file-pin owner and then failing to open its replacement
socket still collapsed submit-on-closed into generic upstream_unavailable.
@mastertyko

Copy link
Copy Markdown
Contributor 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: 9eaac241bd

ℹ️ 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/mixin.py
A budget-expired ClientError or TimeoutError while opening the file-pin
owner's replacement socket still collapsed submit-on-closed to a generic
upstream_unavailable envelope.
@mastertyko

Copy link
Copy Markdown
Contributor 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: bca9ba7f22

ℹ️ 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/mixin.py
A budget-expired RefreshError for the file-pin owner still collapsed
submit-on-closed into generic upstream_unavailable.
@mastertyko

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 9e85128add

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

@Komzpa Komzpa added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: needs work [@codex review] raised an issue labels Aug 15, 2026
@Komzpa
Komzpa merged commit f694c44 into Soju06:main Aug 15, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok [@codex review] says no issues found.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants