Repository navigation
feat(sources): classify Codex response_item/event_msg orphan event types - #3567
Conversation
|
Warning Review limit reached
Next review available in: 30 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
polylogue-fuky's codex response_item classification landed in PR #3567; appended the AC-by-AC resolution notes and filed polylogue-z1rdw to track the deferred field-extraction work for the orphan types that keep passing through unchanged. Co-Authored-By: Claude <[email protected]>
polylogue-fuky's codex response_item classification landed in PR #3567; appended the AC-by-AC resolution notes and filed polylogue-z1rdw to track the deferred field-extraction work for the orphan types that keep passing through unchanged. Co-Authored-By: Claude <[email protected]>
93d05f3 to
1a7cc3c
Compare
Problem: sources/parsers/codex.py's generic session_event dispatch stored any unhandled response_item/event_msg inner type verbatim under Codex's own wire name (event_type=_record_type(inner) or _record_type(record) or "response_item") with zero code awareness of what that name meant. A producer/consumer audit (polylogue-fuky) found a live-archive cluster of such orphans with no literal reference anywhere in the repo: agent_reasoning (318,474 rows), thread_goal_updated, sub_agent_activity, task_started, task_complete, context_compacted, turn_aborted, thread_settings_applied, collab_*, entered/exited_review_mode, view_image_tool_call, item_completed, plus three more found during this audit (web_search_end, thread_rolled_back, error). Solution: adds an explicit classification at the parser boundary (_CODEX_KNOWN_RESPONSE_ITEM_TYPES in codex.py) covering every type that reaches the generic dispatch, both the pre-existing audited ones and this bead's newly-classified orphans, each backed by raw wire samples read directly (not inferred). A type outside this set now routes to a distinct codex_unclassified_response_item bucket instead of silently adopting its own wire name (matching the claude_attachment_unclassified precedent in claude/code_parser.py). agent_reasoning's fate: confirmed DUPLICATE, not merely unclassified. Live-wire comparison across three Codex sessions found agent_reasoning.text is the same live-streamed reasoning-summary bullet text the paired reasoning record already carries in full (summary[].text) -- already materialized as a THINKING-block message via _codex_reasoning_message (index v50). Added to _SESSION_EVENTS_REDUNDANT_TYPES (storage/sqlite/archive_tiers/write.py), matching the v42 agent_message precedent (a twin ParsedMessage already exists). This is index schema version 55 (SEMANTIC_REPARSE, declared in lifecycle.py) -- a writer-materialization change with no DDL delta, so existing rows require `polylogue ops reset --index && polylogued run` to actually drop, not executed here. The remaining orphan types (thread_goal_updated, sub_agent_activity, task_started, task_complete, turn_aborted, thread_settings_applied, collab_*, item_completed, entered/exited_review_mode, view_image_tool_call, web_search_end, thread_rolled_back, error) keep passing through unchanged. Reading their raw wire records found real signal _compact_response_payload's generic allowlist silently drops (e.g. thread_goal_updated's goal.objective free text, sub_agent_activity's subagent delegation fields, error's usage-limit message/code) -- a dedicated extraction pass is filed as polylogue-z1rdw rather than attempted here, since each needs its own bounded field-set decision plus its own SEMANTIC_REPARSE bump. Verification: devtools test tests/unit/sources/test_parsers_codex.py tests/unit/pipeline/test_archive_write.py (114 passed, 1 pre-existing unrelated failure confirmed present on master via git stash -- test_validation_strict_detects_malformed_jsonl_beyond_large_prefix); devtools lab policy schema-versioning (schema evolution policy intact); devtools verify --quick (all 19 steps green, exit 0). Ref polylogue-fuky Co-Authored-By: Claude <[email protected]>
polylogue-fuky's codex response_item classification landed in PR #3567; appended the AC-by-AC resolution notes and filed polylogue-z1rdw to track the deferred field-extraction work for the orphan types that keep passing through unchanged. Co-Authored-By: Claude <[email protected]>
1a7cc3c to
885654e
Compare
Summary
Adds an explicit allowlist-vs-passthrough classification at the Codex parser boundary for every response_item/event_msg inner type that reaches the generic session_event dispatch, and resolves
agent_reasoning's fate (confirmed duplicate, filtered at write time).Problem
sources/parsers/codex.py's generic session_event dispatch stored any unhandled response_item/event_msg inner type verbatim under Codex's own wire name (event_type=_record_type(inner) or _record_type(record) or "response_item") with zero code awareness of what that name meant. A producer/consumer audit (polylogue-fuky) found a live-archive cluster of such orphans with zero literal reference anywhere in the repo:agent_reasoning(318,474 rows),thread_goal_updated,sub_agent_activity,task_started,task_complete,context_compacted,turn_aborted,thread_settings_applied,collab_*,entered/exited_review_mode,view_image_tool_call,item_completed— plus three more found during this audit's own live-archive enumeration (web_search_end,thread_rolled_back,error).Solution
_CODEX_KNOWN_RESPONSE_ITEM_TYPES,sources/parsers/codex.py): every type that reaches the generic dispatch is now named explicitly — both the pre-existing audited ones (token_count,reasoning,function_call, etc.) and this bead's newly-classified orphans — each backed by raw wire samples read directly from live Codex session files, not inferred from row shape. A type outside this set now routes to a distinctcodex_unclassified_response_itembucket instead of silently adopting its own wire name, matching theclaude_attachment_unclassifiedprecedent insources/parsers/claude/code_parser.py.agent_reasoning's fate: confirmed DUPLICATE, not merely unclassified. Live-wire comparison across three Codex sessions foundagent_reasoning.textis the same live-streamed reasoning-summary bullet text the pairedreasoningrecord already carries in full (summary[].text) — one session 156/156 identical, a second 262/262 identical set, a third 1,846 vs 1,859 with >99% overlap.reasoningis already materialized as a THINKING-block message via_codex_reasoning_message(index v50), soagent_reasoningbrings no incremental evidence. Added to_SESSION_EVENTS_REDUNDANT_TYPES(storage/sqlite/archive_tiers/write.py), matching the v42agent_messageprecedent (a twinParsedMessagealready exists).SEMANTIC_REPARSE, declared inlifecycle.py) — a writer-materialization change with no DDL delta onsession_events, so existing rows requirepolylogue ops reset --index && polylogued runto actually drop (not executed by this PR)._compact_response_payload's generic allowlist silently drops today (e.g.thread_goal_updated'sgoal.objectivefree text,sub_agent_activity's subagent-delegation fields,error's usage-limit message/code) — a dedicated extraction pass is filed as polylogue-z1rdw rather than attempted here, since each needs its own bounded field-set decision plus its ownSEMANTIC_REPARSEbump.Alternatives rejected
Renaming every known type's stored
event_typeto acodex_-prefixed vocabulary was considered and rejected: it would force a reparse of every existing row for types whose classification (pass-through, intentional) doesn't actually change, with no reader benefit over the current wire-name-as-event-type convention already established forreasoning/function_call/etc.Verification
devtools test tests/unit/sources/test_parsers_codex.py tests/unit/pipeline/test_archive_write.py— 114 passed, 1 pre-existing unrelated failure (test_validation_strict_detects_malformed_jsonl_beyond_large_prefix, confirmed present on master viagit stash).devtools lab policy schema-versioning— schema evolution policy intact.devtools verify --quick— all 19 steps green, exit 0 (ran twice: once directly, once via the pre-push hook).Ref polylogue-fuky