Repository navigation
fix(proxy): harden long Codex websocket turns - #674
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b0aa9381a
ℹ️ 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: 3606984969
ℹ️ 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 |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52f7fdf441
ℹ️ 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: ffeed146ff
ℹ️ 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: 727d38eb11
ℹ️ 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: 8ea1500c0e
ℹ️ 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: f00adb0f39
ℹ️ 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: 2ff177f6e8
ℹ️ 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: e4203be5ca
ℹ️ 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 |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f8479c3a9
ℹ️ 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: 6c32590437
ℹ️ 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: dbe2571ea8
ℹ️ 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. Can't wait for the next one! ℹ️ 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". |
# Conflicts: # app/modules/proxy/service.py # tests/unit/test_proxy_http_bridge.py # tests/unit/test_proxy_utils.py
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ 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". |
## [1.18.2](v1.18.1...v1.18.2) (2026-05-19) ### Bug Fixes * **api-keys:** map enforced service_tier auto/default to outbound omission ([#611](#611)) ([9a64e23](9a64e23)) * **api-keys:** size usage reservations from request budget ([#706](#706)) ([ea72eea](ea72eea)) * **dashboard:** derive quota status from usage windows ([#686](#686)) ([c463def](c463def)) * **dashboard:** make weekly credit pace backend-driven ([#692](#692)) ([313783c](313783c)) * **db:** recover stale reservations and serialize sqlite writers ([#667](#667)) ([6635628](6635628)) * **model-refresh:** refresh HTTP client on transport errors ([#547](#547)) ([2087df0](2087df0)) * **models:** report full context in v1 metadata ([#681](#681)) ([c3c977d](c3c977d)) * **proxy:** cap selector "Try again in" hint at 300s ([#690](#690)) ([cf09bd6](cf09bd6)), closes [#676](#676) [#678](#678) * **proxy:** eliminate /v1 responses cancel/retry stream contamination ([#696](#696)) ([c9da497](c9da497)) * **proxy:** harden long Codex websocket turns ([#674](#674)) ([12bec0f](12bec0f)) * **proxy:** include sticky thread in budget-pressure guard ([#514](#514)) ([1e2c6d6](1e2c6d6)) * **proxy:** keep idle timeout classification after scheduler jitter ([#693](#693)) ([17e8abc](17e8abc)) * **proxy:** mask partial previous-response stream errors ([#689](#689)) ([a4a138c](a4a138c)) * **proxy:** persist request logs outside cancellation ([#688](#688)) ([6e8fa56](6e8fa56)) * **proxy:** repair interrupted Codex response continuity ([#698](#698)) ([682447f](682447f)) * **proxy:** trim durable full-resend continuations ([#687](#687)) ([dfc38c0](dfc38c0)) * **security:** remediate Docker code scanning alerts ([#699](#699)) ([de24c2e](de24c2e)) ### Documentation * add AnobleSCM as a contributor for code, and test ([#695](#695)) ([718931e](718931e)) * add jgorostegui as contributor ([#697](#697)) ([d9d5a6e](d9d5a6e)) * add linusmixson as contributor ([#705](#705)) ([f3ad60a](f3ad60a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Raise long-turn budgets, disable upstream websocket keepalive watchdogs, and surface/fail over incomplete upstream streams instead of leaving clients hanging. Fixes Soju06#666.
## [1.18.2](Soju06/codex-lb@v1.18.1...v1.18.2) (2026-05-19) ### Bug Fixes * **api-keys:** map enforced service_tier auto/default to outbound omission ([Soju06#611](Soju06#611)) ([ce0d1ea](Soju06@ce0d1ea)) * **api-keys:** size usage reservations from request budget ([Soju06#706](Soju06#706)) ([f3b1689](Soju06@f3b1689)) * **dashboard:** derive quota status from usage windows ([Soju06#686](Soju06#686)) ([acb4133](Soju06@acb4133)) * **dashboard:** make weekly credit pace backend-driven ([Soju06#692](Soju06#692)) ([383ccd4](Soju06@383ccd4)) * **db:** recover stale reservations and serialize sqlite writers ([Soju06#667](Soju06#667)) ([79dced5](Soju06@79dced5)) * **model-refresh:** refresh HTTP client on transport errors ([Soju06#547](Soju06#547)) ([f0b38a0](Soju06@f0b38a0)) * **models:** report full context in v1 metadata ([Soju06#681](Soju06#681)) ([82bd538](Soju06@82bd538)) * **proxy:** cap selector "Try again in" hint at 300s ([Soju06#690](Soju06#690)) ([1242bc1](Soju06@1242bc1)), closes [Soju06#676](Soju06#676) [Soju06#678](Soju06#678) * **proxy:** eliminate /v1 responses cancel/retry stream contamination ([Soju06#696](Soju06#696)) ([d7f3cea](Soju06@d7f3cea)) * **proxy:** harden long Codex websocket turns ([Soju06#674](Soju06#674)) ([0828e63](Soju06@0828e63)) * **proxy:** include sticky thread in budget-pressure guard ([Soju06#514](Soju06#514)) ([e9d5b84](Soju06@e9d5b84)) * **proxy:** keep idle timeout classification after scheduler jitter ([Soju06#693](Soju06#693)) ([0860872](Soju06@0860872)) * **proxy:** mask partial previous-response stream errors ([Soju06#689](Soju06#689)) ([4563488](Soju06@4563488)) * **proxy:** persist request logs outside cancellation ([Soju06#688](Soju06#688)) ([684b1dc](Soju06@684b1dc)) * **proxy:** repair interrupted Codex response continuity ([Soju06#698](Soju06#698)) ([0e8232a](Soju06@0e8232a)) * **proxy:** trim durable full-resend continuations ([Soju06#687](Soju06#687)) ([e017bfc](Soju06@e017bfc)) * **security:** remediate Docker code scanning alerts ([Soju06#699](Soju06#699)) ([1b012f6](Soju06@1b012f6)) ### Documentation * add AnobleSCM as a contributor for code, and test ([Soju06#695](Soju06#695)) ([e95cfca](Soju06@e95cfca)) * add jgorostegui as contributor ([Soju06#697](Soju06#697)) ([4974c52](Soju06@4974c52)) * add linusmixson as contributor ([Soju06#705](Soju06#705)) ([ed41ae0](Soju06@ed41ae0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
ping_interval=None,ping_timeout=None) so long Codex reasoning turns are governed by codex-lb budgets instead of synthetic 1011 keepalive closesFixes #666
Review follow-up
03912ce0a1b4by preserving explicit parsederrorcodes, surfacingstream_idle_timeoutinstead ofno_accountswhen failover has no candidate, preserving the settled flag after visible mid-stream failures, and recording account health before returning surfaced visible-stream errorsValidation
1512d62b00a9b4dd063c98bdcbd62a88174001b9.1512d62b00a9ba11563528cb7fe255ff86c87ea2.sync_codex_ok_labels.pytriggered a fresh current-headreview; do not restore🤖 codex: okuntil that review is clean.uv run pytest -q -ra tests/unit/test_proxy_utils.py::test_stream_responses_first_idle_timeout_surfaces_timeout_when_no_failover_candidate tests/unit/test_proxy_utils.py::test_stream_midstream_proxy_failure_records_health_and_keeps_settled tests/unit/test_proxy_utils.py::test_normalize_http_bridge_error_event_preserves_explicit_error_code_from_parsed_eventuvx ruff check .uvx ruff format --check .uv run ty check app/modules/proxy/service.py tests/unit/test_proxy_utils.pyPrevious validation retained from this PR:
uvx ruff check app/modules/proxy/service.py tests/unit/test_proxy_utils.py && uv run pytest -q -ra tests/unit/test_proxy_utils.py::test_cancel_safe_cleanup_tracks_background_task_until_done tests/unit/test_proxy_utils.py::test_websocket_receive_timeout_uses_request_budget_when_idle_covers_full_budget tests/unit/test_proxy_websocket_client.py::test_connect_responses_websocket_uses_websockets_transport && uv run ty check app/modules/proxy/service.py tests/unit/test_proxy_utils.pyuv run pytest -q -ra tests/unit/test_proxy_websocket_client.py::test_connect_responses_websocket_uses_websockets_transportuv run python -m pytest tests/unit/test_proxy_utils.py::test_stream_responses_first_idle_timeout_fails_over_to_next_account tests/unit/test_proxy_utils.py::test_stream_responses_empty_upstream_emits_terminal_failure tests/unit/test_proxy_utils.py::test_stream_responses_first_event_connection_reset_fails_over tests/unit/test_proxy_utils.py::test_reconnect_http_bridge_skips_extra_same_account_retry_after_keepalive_close tests/unit/test_proxy_utils.py::test_retry_http_bridge_precreated_request_preserves_reconnect_timeout_cause tests/unit/test_http_bridge_forwarding.py::test_owner_forward_uses_direct_session_without_env_proxyuv run python -m pytest tests/unit/test_proxy_utils.py tests/unit/test_http_bridge_forwarding.pyuvx ruff check .uvx ruff format --check .uv run ty check app/modules/proxy/service.py app/modules/proxy/http_bridge_forwarding.py tests/unit/test_proxy_utils.py tests/unit/test_http_bridge_forwarding.pyprevious validation retained from this PR:
uv run pytest -q -ra tests/unit/test_settings_multi_replica.py tests/unit/test_proxy_utils.py::test_fail_pending_websocket_requests_penalizes_upstream_stream_drop tests/integration/test_proxy_websocket_responses.py -o faulthandler_timeout=300 -o faulthandler_exit_on_timeout=true --timeout=180 --timeout-method=thread --durations=20previous validation retained from this PR:
uv run ty check app/core/config/settings.py app/modules/proxy/service.py tests/unit/test_settings_multi_replica.py tests/unit/test_proxy_utils.pyprevious validation retained from this PR:
openspec validate --specsgit diff --checkuv run pytest -q -ra tests/integration/test_proxy_transient_retry.py::test_stream_http_500_after_text_is_surfaced_without_same_account_replay tests/integration/test_proxy_transient_retry.py::test_stream_http_429_after_text_is_surfaced_without_account_failover tests/integration/test_proxy_transient_retry.py::test_stream_mid_stream_error_is_surfaced_without_failover tests/integration/test_proxy_transient_retry.py::test_stream_http_500_retries_same_account_then_succeeds tests/integration/test_proxy_transient_retry.py::test_stream_http_500_exhausts_then_failover tests/integration/test_proxy_transient_retry.py::test_stream_connect_phase_429_usage_limit_transparent_failover tests/unit/test_proxy_utils.py::test_stream_midstream_generic_failure_is_neutral_to_account_healthuv run pytest -q -ra tests/unit/test_proxy_utils.py::test_retry_http_bridge_precreated_request_suppresses_retry_after_response_event tests/unit/test_proxy_utils.py::test_pop_replayable_precreated_request_suppresses_replay_after_response_event tests/unit/test_proxy_http_bridge.py::test_retry_http_bridge_request_on_fresh_upstream_refuses_after_response_eventuvx ruff check app/modules/proxy/service.py tests/unit/test_proxy_utils.py tests/unit/test_proxy_http_bridge.pyuv run ty check app/modules/proxy/service.py tests/unit/test_proxy_utils.py tests/unit/test_proxy_http_bridge.pyuv run pytest -q -ra tests/unit/test_proxy_utils.py::test_websocket_precreated_retry_error_code_does_not_replay_after_response_event tests/unit/test_proxy_http_bridge.py::test_submit_http_bridge_request_rejects_state_after_response_event tests/unit/test_proxy_http_bridge.py::test_retry_http_bridge_request_on_fresh_upstream_refuses_after_response_event tests/unit/test_proxy_utils.py::test_retry_http_bridge_precreated_request_suppresses_retry_after_response_eventuv run pytest -q -ra tests/integration/test_proxy_websocket_responses.py tests/integration/test_http_responses_bridge.py --durations=20uv run pytest -q -ra tests/unit/test_proxy_http_bridge.py::test_stream_via_http_bridge_does_not_rebind_after_downstream_visible tests/unit/test_proxy_http_bridge.py::test_stream_via_http_bridge_reacquires_api_key_reservation_for_local_previous_response_rebind tests/unit/test_proxy_http_bridge.py::test_stream_via_http_bridge_reacquires_api_key_reservation_after_owner_forward_failureuv run pytest -q -ra tests/unit/test_proxy_http_bridge.py tests/integration/test_http_responses_bridge.py tests/integration/test_proxy_websocket_responses.py --durations=20uvx ruff check app/modules/proxy/service.py tests/unit/test_proxy_http_bridge.py && uv run ty check app/modules/proxy/service.py tests/unit/test_proxy_http_bridge.py