Skip to content

[codex] Remove external client session reset plumbing#24157

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/remove-external-reset-client-session
May 22, 2026
Merged

[codex] Remove external client session reset plumbing#24157
pakrym-oai merged 2 commits into
mainfrom
pakrym/remove-external-reset-client-session

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

@pakrym-oai pakrym-oai commented May 22, 2026

Why

The turn loop no longer needs to decide when a ModelClientSession should reset its websocket state after compaction. That reset behavior belongs inside the model client, where the websocket cache and retry state are owned. The repo guidance now calls this out explicitly so future changes let the incremental request logic decide whether the previous request can be reused.

What Changed

  • Removed the reset_client_session return value from pre-sampling and auto-compact helpers in core/src/session/turn.rs.
  • Changed compaction helpers to return CodexResult<()> so callers only handle success or failure.
  • Made ModelClientSession::reset_websocket_session private to core/src/client.rs, leaving it callable only from model-client internals.
  • Added AGENTS.md guidance not to call reset_client_session unnecessarily.

Validation

  • just test -p codex-core session::turn

@pakrym-oai pakrym-oai marked this pull request as ready for review May 22, 2026 23:45
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 22, 2026 23:45
@pakrym-oai pakrym-oai merged commit 6ad3a83 into main May 22, 2026
31 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/remove-external-reset-client-session branch May 22, 2026 23:46
@github-actions github-actions Bot locked and limited conversation to collaborators May 22, 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