feat(trace): add agk trace diff to compare two runs#17
Open
kunalkushwaha wants to merge 1 commit into
Open
Conversation
Answers "did my change help?" by diffing two trace runs across duration, spans, LLM calls, tokens, and estimated cost, with colored deltas (improvements green, regressions red) and percentage change. Run selection: agk trace diff # two most recent runs agk trace diff <a> # <a> (baseline) vs latest agk trace diff <a> <b> # explicit pair Pairs naturally with `agk run`'s trace summary and the per-model cost work. Includes unit tests for the delta direction, metric set, and formatting (the cmd package's first tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds
agk trace diff— compare two trace runs to answer "did my change help?". This is feature B5 from theFEATURES.mdroadmap, and it pairs naturally withagk run's trace summary (#13) and the per-model cost work (#15).Behavior
Diffs two runs across duration, spans, LLM calls, tokens, and estimated cost, showing the delta with an arrow + percentage. For duration/tokens/cost (lower-is-better), improvements are green and regressions red.
Run selection
agk trace diffagk trace diff <a><a>(baseline) vs the latest runagk trace diff <a> <b>Testing
go build,go vet,go test ./...,gofmtall green.🤖 Generated with Claude Code