Skip to content

Fix negative durations from clock-skewed transcripts - #26

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/negative-duration
Sep 7, 2026
Merged

Fix negative durations from clock-skewed transcripts#26
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/negative-duration

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown
Contributor

Clock-skewed transcripts could produce negative run durations and reduce the total agent time. Treat an end timestamp earlier than the start as an unknown duration (None), which the CLI already excludes from duration statistics.

The regression test checks that durations [-5, 10, 20] total 30 seconds with a median of 15 seconds. It failed before the fix (total 25 seconds). All 29 tests pass; the updated test file passes Ruff and git diff --check passes.

Closes #22.

@royalpinto007
royalpinto007 merged commit 035c607 into AgentPostmortem:main Sep 7, 2026
8 checks passed
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

This is in, @Gambit-Checkmate. Really appreciate it.

Good, focused change. Exactly the kind of thing Agentrace needs.

If Agentrace is useful to you, a star goes a long way.

Happy to see more from you whenever you have the time.

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.

Negative durations from clock-skewed transcripts flow into stats

2 participants