Skip to content

fix(tier3): leave inferred timing N/A when a tool step is not followed by an agent step - #365

Merged
rng1995 merged 2 commits into
mainfrom
naren/followup-344-tool-step-gap
Nov 6, 2026
Merged

rng1995 merged 2 commits into
mainfrom
naren/followup-344-tool-step-gap

Conversation

@rng1995

@rng1995 rng1995 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #344, which merged before its last review round. #344 infers LLM and tool seconds from step timestamps when a trajectory has no native ATIF timing. For each tool step, it counts the gap to the next step, minus the tool's wall time, as LLM time. When the next step is a user or system step, that gap can be idle or user time, not model time.

Example on main: a user step at 0 s, a tool step at 2 s with a 1 s call, a user step at 40 s and an agent step at 43 s report 42.0 LLM seconds and 1.0 tool seconds. 37 of those LLM seconds are the wait before the user step.

  • trajectory_timing now leaves the trial unmeasured (N/A) when a tool step is followed by a user or system step, also when that step is the last one. Only the agent's next step shows when the model finished with the tool output.
  • When the agent replies to the tool output before the user or system step, the trial is still timed, and the gap before the user or system step is still not counted (7.0 LLM and 1.0 tool seconds for the example with an agent step at 5 s).
  • Native ATIF timing is unchanged.
  • docs/reports.mdx ("Measured agent resources") and the module docstring state the new rule. A second commit wraps the long line about omitted trajectories and splits the coverage text into three paragraphs: tool coverage, multi-step and copied context, and missing timing. No prose line in that section is longer than 80 columns; its table rows, which cannot be wrapped, are unchanged.
  • No CHANGELOG change. The feat(tier3): split measured agent time into LLM and tool seconds #344 entry under Unreleased > Added names unmeasured tool calls only as an example of N/A and does not list the individual conditions. The Harbor 0.24 Codex converter fixture, which has user and system steps only before the first agent step, is still timed.

Why

Timing must never guess missing evidence. Counting a wait for a user or system step as model time inflates LLM seconds and LLM ms per token for that arm, and the with-skill-minus-baseline delta can then show a skill as slower when it is not.

Kept from public

Tests

  • New test_tool_step_followed_by_a_user_or_system_step_is_unmeasured in tests/tier3/test_trajectory_timing.py, with user and system cases. Both fail on main (42.0 LLM and 1.0 tool seconds instead of no timing); the other 60 tests in the file pass there.
  • tests/tier3/test_trajectory_timing.py, tests/tier3/test_resource_usage.py and tests/reporting/test_resource_comparison.py: 107 passed.
  • tests/tier3 and tests/reporting (-n 8): 11208 passed, 3 skipped, 13 failed. The 13 failures are in tests/tier3/test_judge_failure_artifacts.py, which runs a generated script with the system python3 (3.9 in this local environment); they fail the same way on main.
  • ruff check and ruff format --check are clean on the changed Python files, and scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 2 commits November 5, 2026 20:08
…d by an agent step

Inference charged the whole gap after a tool step, minus the tool time,
to the model. When the next step is a user or system step, that gap can
be idle or user time: a 1 s tool call followed by a user step 98 s later
reported about 100 s of LLM time. Only the agent's next step shows when
the model finished with the tool output, so such a trajectory now has no
inferred timing, matching the rule that missing evidence is never
guessed. Native ATIF timing is unaffected.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Wrap the long line about omitted trajectories at 80 columns and split
the coverage text into three paragraphs: tool coverage, multi-step and
copied context, and missing timing. The wording is unchanged; only the
paragraph breaks are new.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed. Requiring the step right after a tool step to be an agent step is the right rule: a user or system step there can only bound idle or user time, so leaving the trial N/A is safer than over-counting LLM seconds. The test covers the interjection in the middle and at the end, plus the case where the agent replies first and the trial is still timed (7.0 / 1.0). Docs and the module docstring match the code. Nothing blocking from me.

@rng1995
rng1995 marked this pull request as ready for review November 6, 2026 12:20
@rng1995
rng1995 merged commit db62830 into main Nov 6, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/followup-344-tool-step-gap branch November 6, 2026 12:21
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased (#371)

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants