Support Codex 0.130 JSON agent messages#27
Conversation
Accept both legacy assistant_message and current agent_message item.completed payloads, and keep usage metadata flowing from turn.completed events. Constraint: Codex CLI 0.130.0 emits item.type=agent_message and turn.completed usage while older versions used item_type=assistant_message and task_complete. Rejected: Replacing the parser branch wholesale | the compatibility gap is narrow and the existing adapter shape already handles adjacent Codex events. Confidence: high Scope-risk: narrow Directive: Preserve both old and new Codex JSON shapes when changing this adapter. Tested: pnpm exec tsc --noEmit; parser regression script for assistant_message, agent_message, and turn.completed usage; pnpm build. Not-tested: Live /api/convert run against Codex 0.130.0 in this branch. Co-authored-by: OmX <omx@oh-my-codex.dev>
db014b9 to
92b0ce0
Compare
|
Heads-up: PR #14 is also open in this area — both PRs touch |
PerishCode
left a comment
There was a problem hiding this comment.
@tackcrypto1031 Nice surgical fix for the Codex 0.130 JSON shift. The parser now accepts both legacy item_type=assistant_message and current type=agent_message in item.completed, and emits the usage meta from both task_complete and turn.completed, so older and newer Codex CLIs keep working through the same adapter. The nullish-coalescing fallback (item.item_type ?? item.type) and the inline type widening to include type?: string are exactly the right minimal touch — no other Codex branches are perturbed, and the change reads cleanly against the surrounding argv.ts shape. Verification (pnpm exec tsc --noEmit, the parser regression script for assistant_message/agent_message/turn.completed.usage, and pnpm build) is appropriately scoped for a parser bugfix in a repo without a test suite. Thanks for keeping both old and new shapes alive instead of replacing the branch — that's the right call for a CLI that ships JSON changes between point releases. Great work! 🚀
🔁 Powered by Looper · runner=reviewer · agent=claude-code · An autonomous AI dev team for your GitHub repos.
|
Heads-up: PR #50 is now open and also touches PR #50 is broader — it also includes Gemini/Copilot parsing and UI waiting logs — so this is mainly a scope coordination note for the authors and reviewer before the maintainer team picks the path to land. |
|
Heads-up: PR #52 is now open and also touches PR #52 additionally includes the |
Summary
item.item_type = assistant_messageand currentitem.type = agent_messagecompleted-item payloads.turn.completed.usageas usage metadata while preserving existingtask_completesupport.Fixes #23
Verification
pnpm exec tsc --noEmitassistant_message,agent_message, andturn.completed.usagepnpm build(passes; existing Turbopack NFT tracing warning remains)