Skip to content

[codex] Remove external websocket session resets#23384

Merged
pakrym-oai merged 1 commit into
mainfrom
pakrym/remove-external-reset-websocket-session
May 19, 2026
Merged

[codex] Remove external websocket session resets#23384
pakrym-oai merged 1 commit into
mainfrom
pakrym/remove-external-reset-websocket-session

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

Compaction now installs replacement history inside the session, but the turn and compaction callers were still reaching into ModelClientSession to reset websocket transport state after that install. That made a transport-level reset part of the compaction API even though websocket incremental request selection already checks whether the next request is a strict extension of the previous one and falls back to a full response.create when it is not.

What changed

  • Removed the compaction-side calls to reset_websocket_session from compact.rs and session/turn.rs.
  • Simplified pre-sampling and mid-turn compaction helpers so they return CodexResult<()> instead of carrying a reset flag.
  • Made ModelClientSession::reset_websocket_session private to client.rs, leaving only the websocket timeout recovery path inside the client as a caller.

Validation

  • cargo test -p codex-core --test all responses_websocket_creates_on_non_prefix
  • cargo test -p codex-core --test all steered_user_input_waits_for_model_continuation_after_mid_turn_compact
  • cargo test -p codex-core --test all pre_sampling_compact_runs_on_switch_to_smaller_context_model

@pakrym-oai pakrym-oai marked this pull request as ready for review May 19, 2026 00:40
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 19, 2026 00:40
@pakrym-oai pakrym-oai enabled auto-merge (squash) May 19, 2026 01:04
@pakrym-oai pakrym-oai merged commit 17d552f into main May 19, 2026
46 of 47 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/remove-external-reset-websocket-session branch May 19, 2026 01:13
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants