[#79]: Handle UserInput and ThreadSettings for Codex v0.133.0+ sessions#87
Open
delexw wants to merge 1 commit into
Open
[#79]: Handle UserInput and ThreadSettings for Codex v0.133.0+ sessions#87delexw wants to merge 1 commit into
delexw wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #79 — Codex v0.133.0 (2026-05-21) removed the
UserTurnandUserInputWithTurnContextresponse_item types from session transcripts (PRs #23075, #23081) and replaced them with a splitUserInput+ThreadSettingsmodel (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.rs—handle_response_itemAdded two new match arms:
"user_input": extracts the user's message text from acontentfield (plain string or[{"type":"text","text":"..."}]array). Mirrors the existinguser_turncompat handler. Does not overwrite an existinguser_messageset by auser_messageevent_msg."thread_settings": readsmodel,cwd, andeffortfields and applies them to the current turn. Mirrors the context extraction from the existinguser_input_with_turn_contextcompat handler. Only fills fields that are stillNone, soturn_contextentries (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:user_input_response_item_string_content_is_capturedcontentfielduser_input_response_item_content_array_is_capturedcontentarray ([{"type":"text","text":"..."}])user_input_does_not_overwrite_existing_user_messageuser_messageevent winsthread_settings_response_item_captures_context_fieldsthread_settings_partial_fields_are_appliedNone)v0133_full_session_with_user_input_and_thread_settingsAll 137 Rust tests pass. Clippy clean (
-D warnings).