fix(web): show Codex round usage metadata - #1685
Conversation
There was a problem hiding this comment.
Findings
- [Major] Imported local Codex history receives replay-time Round durations. See the inline finding at
cli/src/codex/codexLocalLauncher.ts:220.
Summary
- Review mode: initial
- One correctness issue found: replayed transcript usage is promoted to Codex round metadata even though its timestamps are hub replay stamps rather than original turn timing.
Testing
- Not run (automation; PR content was not executed). GitHub
test,integration, anddrift-gatechecks are passing. Add a regression for imported local history that asserts no derived duration unless original timestamps are available.
HAPI Bot
| ? message | ||
| : context.replayedHistory | ||
| ? { ...message, model: transcriptModel, hapiUsageScope: 'imported-history' } | ||
| ? { ...message, flavor: 'codex', model: transcriptModel, hapiUsageScope: 'imported-history' } |
There was a problem hiding this comment.
[MAJOR] Imported history gets fabricated Round durations
This branch now adds flavor: codex to replayed token counts, so the web normalizer marks them as Codex and aggregateResponseGroups derives a duration. However replayed user/agent entries are sent without their original createdAt; the hub therefore gives each no-localId row replay-time createdAt/invokedAt (hub/src/store/messages.ts:145). The displayed value measures replay/loader speed, not the historical turn.
Suggested fix:
? { ...message, model: transcriptModel, hapiUsageScope: imported-history }Keep the Codex flavor only on managed/live usage, or propagate the scope and skip duration derivation for imported history. Add an import regression covering this path.
There was a problem hiding this comment.
Findings
- None.
Summary
Review mode: follow-up after new commits
- The previous imported-history duration issue is resolved at
cli/src/codex/codexLocalLauncher.ts:220: replayed token counts no longer carry the Codex marker, andweb/src/chat/reducerTimeline.test.ts:239covers the no-summary behavior. - No additional issues found in the latest full diff.
- Residual risk: duration is covered by separate reducer/runtime tests rather than one full normalize-to-render pipeline test.
Testing
- Not run (automation; PR content was not executed). GitHub
integrationanddrift-gatepass;testwas still in progress at review time. - Suggested: add a normalize →
reduceTimeline→aggregateResponseGroupsregression asserting imported history has no Round while live usage derives duration from the user invocation.
HAPI Bot
Summary
Round: <duration> · <turns> turn(s).Validation
bun typecheck— passed.bun run test:e2e -- terminal-wrap-fidelity.spec.ts— 2 passed.bun run build— passed.Related Issues
None
AI Disclosure
Implemented and tested with OpenAI Codex (GPT-5.6).