Skip to content

[#79]: Handle UserInput and ThreadSettings for Codex v0.133.0+ sessions#87

Open
delexw wants to merge 1 commit into
mainfrom
fix-issue-79
Open

[#79]: Handle UserInput and ThreadSettings for Codex v0.133.0+ sessions#87
delexw wants to merge 1 commit into
mainfrom
fix-issue-79

Conversation

@delexw
Copy link
Copy Markdown
Contributor

@delexw delexw commented May 31, 2026

Summary

Fixes #79 — Codex v0.133.0 (2026-05-21) removed the UserTurn and UserInputWithTurnContext response_item types from session transcripts (PRs #23075, #23081) and replaced them with a split UserInput + ThreadSettings model (PRs #23080, #22508). Without this fix, all user-turn entries in sessions captured from v0.133.0+ are silently skipped, breaking turn sequencing and conversation replay.

Changes

src-tauri/src/parser/turn.rshandle_response_item

Added two new match arms:

  • "user_input": extracts the user's message text from a content field (plain string or [{"type":"text","text":"..."}] array). Mirrors the existing user_turn compat handler. Does not overwrite an existing user_message set by a user_message event_msg.

  • "thread_settings": reads model, cwd, and effort fields and applies them to the current turn. Mirrors the context extraction from the existing user_input_with_turn_context compat handler. Only fills fields that are still None, so turn_context entries (which arrive later) continue to take precedence.

Both legacy compat handlers (user_turn, user_input_with_turn_context) are kept intact for backward-compatibility with pre-v0.133.0 transcripts.

Tests

7 new tests added in parser::turn::tests:

Test Coverage
user_input_response_item_string_content_is_captured plain string content field
user_input_response_item_content_array_is_captured content array ([{"type":"text","text":"..."}])
user_input_does_not_overwrite_existing_user_message precedence: user_message event wins
thread_settings_response_item_captures_context_fields all three context fields
thread_settings_partial_fields_are_applied partial fields (absent ones stay None)
v0133_full_session_with_user_input_and_thread_settings full end-to-end v0.133.0 session

All 137 Rust tests pass. Clippy clean (-D warnings).

Codex v0.133.0 (PRs #23075, #23081) removed the UserTurn and
UserInputWithTurnContext response_item types and replaced them with a
unified UserInput + ThreadSettings model (PRs #23080, #22508).

Add two new match arms in handle_response_item:
- "user_input": extracts user message text (plain string or content
  array), replacing the role previously played by "user_turn"
- "thread_settings": applies per-turn context (model, cwd, effort),
  replacing the context half of "user_input_with_turn_context"

Both arms are no-ops when the fields are already set, preserving the
existing precedence rules (user_message event_msg wins over
response_item content).

Add 7 new tests covering: string content, content array, no-overwrite
guard, partial thread_settings, and a full v0.133.0 end-to-end session.

Fixes #79
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.

[Compat] Codex v0.133.0: UserTurn and UserInputWithTurnContext removed from session transcripts

1 participant