Task · CAOT-0014

Codex decoder: deduplicate the duplicated item representations

Description

response_item:custom_tool_call and event_msg:item_completed describe the same tool call. So do response_item:agent_message and event_msg:agent_message, and response_item:reasoning and the Reasoning item. Without deduplication every tool call is counted twice and nothing about the totals looks wrong.

Acceptance Criteria

Definition of Done

Implementation Plan

Wave 1 lane 5: write table-driven tests first, implement Codex sessions/items/dedup within the frozen model, and prove duplicate representations count once; root integrates and runs the final gate.

Final Summary

Codex duplicate representations deduplicate by complete item id with completed timing preferred and drop accounting; regression tests passed.

References

View the source file on GitHub