Skip to content

Show a run summary with steps, time, tokens, and cost - #16

Merged
vicgupta merged 1 commit into
mainfrom
issue-15-run-summary
Oct 24, 2026
Merged

vicgupta merged 1 commit into
mainfrom
issue-15-run-summary

Conversation

@vicgupta

Copy link
Copy Markdown
Owner

Closes #15

Summary

  • Every run now ends with one summary line on stderr (stdout stays model text only; exit codes unchanged), e.g. Submitted after 12 steps in 1m42s (48,213 input / 3,104 output tokens, $0.23).
  • Cost is shown only when > 0 (2 decimals from one cent up, 4 below). The token/cost parenthetical is omitted when no model response arrived (Interrupted after 0 steps in 2s). Errors append : <message> and keep the existing hint: line.
  • Durations render as 12s, 1m42s, 1h02m.
  • trajectory.Trajectory gains additive input_tokens / output_tokens fields; the agent loop accumulates them alongside cost.
  • reportFailure is replaced by reportSummary, called for every exit status.
  • README documents the summary line under Exit status.

Tests

  • New table-driven TestSummaryLine (submitted, limit, error, zero cost, zero steps) and TestReportSummary (error + hint, success).
  • TestRunSubmits asserts token totals land in the trajectory.
  • go build ./..., go vet ./..., go test ./... all pass.

@vicgupta
vicgupta merged commit 92175cf into main Oct 24, 2026
@vicgupta
vicgupta deleted the issue-15-run-summary branch October 24, 2026 15:38
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.

Show a run summary with steps, time, tokens, and cost

1 participant