Skip to content

Populate TurnRecord.fidelity from Codex parser (#84)#115

Merged
willwashburn merged 2 commits intomainfrom
feat/codex-fidelity-84
Apr 26, 2026
Merged

Populate TurnRecord.fidelity from Codex parser (#84)#115
willwashburn merged 2 commits intomainfrom
feat/codex-fidelity-84

Conversation

@willwashburn
Copy link
Copy Markdown
Member

@willwashburn willwashburn commented Apr 26, 2026

Summary

Test plan

  • pnpm run build passes
  • pnpm run test:ts — 457 tests pass (5 new under parseCodexSession fidelity (issue #84)):
    • full-fidelity coverage when token_count is present
    • class === 'partial' when token_count is absent for a turn
    • tool-result coverage stays true when both function_call and function_call_output are present
    • every emitted turn carries fidelity (the summarizeFidelity unknown === 0 requirement)
    • incremental parser also populates fidelity on emitted turns

Refs

Closes #84. Refs #41, #76.


Open in Devin Review

Both parseCodexSession and parseCodexSessionIncremental now stamp every
emitted turn with `fidelity` at `granularity: 'per-turn'`, mirroring the
Claude parser's `buildClaudeFidelity` helper. Coverage flags follow the
rollout source: usage flags (`hasInputTokens` / `hasOutputTokens` /
`hasReasoningTokens` / `hasCacheReadTokens`) flip to true only when a
`token_count` event with `total_token_usage` arrived between task_started
and task_complete, so turns missing usage land in `class: 'partial'`
rather than silently reporting zeros as full fidelity. Tool-call /
tool-result / raw-content flags are treated as capability not presence.
`hasCacheCreateTokens` and `hasSessionRelationships` remain false —
Codex rollouts have no cache-create or parent-tracking concept (the
latter waits on #42 / #63).

Closes #84. Refs #41, #76.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

Codex parser: populate TurnRecord.fidelity

1 participant