fix(codex): parse the new rollout schema (item_completed) from Codex ≥ ~0.149 - #170
Merged
graykode merged 2 commits intoSep 14, 2026
Merged
Conversation
…≥ ~0.149 Recent Codex CLI versions replaced the user_message / agent_message / function_call vocabulary with item_completed wrappers, leaving sessions with empty chat, no tool timeline, no turn count and a status stuck on Waiting. Handle the new item types — UserMessage/AgentMessage for chat, CommandExecution (with real durations) and Extension for the tool timeline, FileChange for file accesses, which the old schema never carried at all — and adjust generating-state transitions via task_started/turn_aborted. Old-schema parsing is untouched.
graykode
approved these changes
Sep 14, 2026
graykode
left a comment
Owner
There was a problem hiding this comment.
Reviewed the updated parser and its integration with #161. Opaque command/script/extension contents are omitted from tool previews, displayed path metadata is sanitized and bounded, and progress/tool-completion events preserve the active turn. Regression tests cover lifecycle transitions, private content, malformed items, and history limits. All 223 local tests, Clippy, the release build, and required CI pass at e2aabfd. No new command execution, network access, or dependency changes were introduced.
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.
Codex rollouts using
event_msg.item_completedwere missing chat, tool history, and file activity in abtop. This adds parsing for UserMessage, AgentMessage, CommandExecution, FileChange, and Extension items while retaining the existing event formats and Code Mode handling from #161.Progress messages and completed tools keep an active turn running. A final_answer message, task_complete, or turn_aborted ends it; a new user item clears the previous completion state. Command durations accept timestamps on either the item or its wrapper.
Tool previews contain only a known operation and sanitized, bounded path metadata. Raw commands, scripts, patch bodies, and extension queries are omitted. Unknown operations use a fixed label. File-access history is bounded, and missing or unknown fields are tolerated. No new dependencies, external requests, or command execution are introduced.
Validation: full
cargo test --locked,cargo clippy --locked --all-targets -- -D warnings, andcargo build --release --locked. Regression tests cover turn lifecycle, private payload exclusion, terminal control/bidi sanitization, malformed items, history limits, and the custom-tool privacy protection from #161.