Skip to content

fix(codex): parse the new rollout schema (item_completed) from Codex ≥ ~0.149 - #170

Merged
graykode merged 2 commits into
graykode:mainfrom
DaeYounLee:fix/codex-item-completed-schema
Sep 14, 2026
Merged

graykode merged 2 commits into
graykode:mainfrom
DaeYounLee:fix/codex-item-completed-schema

Conversation

@DaeYounLee

@DaeYounLee DaeYounLee commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex rollouts using event_msg.item_completed were 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, and cargo 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.

DaeYounLee and others added 2 commits August 22, 2026 13:07
…≥ ~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 graykode left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@graykode
graykode merged commit 4b96568 into graykode:main Sep 14, 2026
7 checks passed
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.

2 participants