Repository navigation
feat(timing): persist runner-measured duration - #319
Merged
Merged
Conversation
Measure eval-agent subprocess time at the universal runner boundary so every harness records a comparable duration. Preserve independent token and duration provenance while keeping historical timing records readable.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Runner-dispatched Codex runs expose token usage but no native duration, which left all-Codex campaign timing summaries with zero duration samples. The universal runner already owns the subprocess lifecycle, so it can provide one cross-harness measurement without relying on transcript-specific timestamps.
This change measures and persists elapsed eval-agent subprocess time for every supported harness and carries that value into canonical
timing.jsonartifacts.Fixes #310.
Measurement contract
The measurement applies to Codex, Claude Code, Cline, OpenCode, and runner-ready BYOH descriptors without adding a harness-specific capability.
Artifact and compatibility behavior
duration_msto runner-ownedconversation.jsoncompletion artifacts.timing.jsonwhile keeping canonical timing out ofrun.json.sourcewriter contract with independenttoken_sourceandduration_sourcefields, including therunnerduration source.source; reserialization emits explicit per-metric provenance.timing.jsonunless the operator requests overwrite behavior.Before, a Codex timing artifact could not supply a duration sample:
{ "total_tokens": 1234, "duration_ms": null, "source": "transcript" }Runner-driven ingestion writes independent provenance:
{ "total_tokens": 1234, "duration_ms": 42891, "token_source": "transcript", "duration_source": "runner" }Aggregation checks source consistency independently for tokens and duration, so mixed provenance remains visible without conflating the two metrics.
Review notes
core::timingmodule and remains re-exported through the existingcore::typessurface.Verification
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo testcargo run --quiet -- dispatch --helpcargo run --quiet -- record-runs --helpcargo run --quiet -- docs conversationscargo run --quiet -- docs byoh