fix(codex): measure real tool-call duration from item.started#103
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
The Codex runner only handled item.completed, reading both startTime and endTime inside that handler — so every tool call recorded a ~0s active duration and Codex effectively always scored ~100 on Setup Speed, unlike the other three runners. Capture the start timestamp on item.started (keyed by item id) and use it when the item completes, falling back to now for items whose start was never observed.
186e1dd to
1e6272c
Compare
Summary
The Codex runner stamped a tool call's
startTimeinside theitem.completedhandler, immediately before computingendTime— so every tool call had a ~0s duration regardless of how long it actually ran. This made the Setup Speed dimension meaningless for Codex (active tool time was always ~0).This captures the start timestamp on
item.started(keyed by item id) and uses it as theToolCallRecord.startTimewhen the matchingitem.completedarrives, so the recorded duration reflects the real active window. If anitem.startedwas never seen for an id, it falls back tonow(keeping the duration non-negative).Changes
packages/eval/src/runners/codex/agent.ts:itemStartTimes: Map<string, number>to the run context.item.started— record the start timestamp per item id.item.completed— look up the captured start time (fallback to now), delete the entry, and pass it as the tool call'sstartTime.packages/eval/tests/runners/codex-agent.test.ts— tests asserting the duration reflects the started→completed window (other items completing in between advance the clock) and that a missingitem.startedyields a non-negative duration.Test plan
evalcodex-agent tests (35 pass)