feat(timeline): structured session timeline view (#81)#126
Merged
Conversation
- timeline.py: build_timeline, format_timeline, format_timeline_json, cmd_timeline - Groups events into phases (reuses explain.py phase detection) - Shows tool calls, file ops, LLM requests, errors, retries per phase - Cost estimates per phase and session (reuses cost.py pricing) - Wasted-spend callout for failed phases - Retry detection: same tool+args called more than once - --format json for machine-readable output - --model flag for cost estimate pricing (sonnet/opus/haiku/gpt4/gpt4o) - 66 tests in tests/test_timeline.py - README: new timeline section and command reference entries - Version bump 0.50.0 → 0.51.0 Closes #81 Co-authored-by: Ona <no-reply@ona.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
agent-strace timeline— a structured, phase-by-phase view of a session showing tool calls, file operations, LLM requests, errors, retries, and a wasted-spend callout for failed phases.Closes #81
Example
Changes
src/agent_trace/timeline.py— new module (build_timeline,format_timeline,format_timeline_json,cmd_timeline)src/agent_trace/cli.py— registerstimelinesubparsertests/test_timeline.py— 66 testsREADME.md— new section + command reference entriessrc/agent_trace/__init__.py— version 0.50.0 → 0.51.0Design notes
explain.pyfor phase detection andcost.pyfor token/cost estimation — no new dependencies--format jsonemits the full phase/entry tree for downstream tooling--modelselects pricing table (sonnet/opus/haiku/gpt4/gpt4o)