Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Displays formatted statistics at the end of each run: model timing/tokens, action counts, and per-issue operation summary.

Changes

  • Statistics tracking (src/stats.ts): Collects model run metrics (duration, p95, token usage), action counts (triaged/skipped/failed), and API call totals
  • Token usage extraction (src/gemini.ts): Returns promptTokenCount and candidatesTokenCount from response metadata
  • API call counting (src/github.ts): Increments counter on each API method, exposed via getApiCallCount()
  • Operation details (src/triage.ts): Each operation implements getActionDetails() for summary formatting
  • Integration (src/index.ts): Tracks timing around model calls, records operations, prints summary before exit

Output

📊 Run Statistics:
  Fast
    Total: 1m12s • Avg: 1.7s • p95: 3.4s
    Tokens used: 39k input, 10k output
  Pro
    Total: 3m32s • Avg: 5.7s • p95: 7.4s
    Tokens used: 4.0k input, 1.0k output
  Actions performed: ✅ 38 triaged, ℹ️ 59 skipped, ❌ 1 failed
  GitHub API calls: 199

📋 Summary of Actions Performed:
  owner/repo#42: labels: +bug, +enhancement
  owner/repo#7: comment
  owner/repo#15: title change
  owner/repo#99: state: completed
Original prompt

This section details on the original issue you should resolve

<issue_title>Add summary/statistics to the end of run</issue_title>
<issue_description>Log useful results at the end of the run. Use colors, emojis, and friendly formatting. Add tests.

Example (include more than just these):

📊 Run Statistics:
  Fast
    Total: 1m12s • Avg: 1.7s • p95: 3.4s
    Tokens used: 39k input, 10k output
  Pro
    Total: 3m32s • Avg: 5.7s • p95: 7.4s
    Tokens used: 4k input, 1k output
  Actions performed: ✅ 38 triaged, ℹ️ 59 skipped, ❌ 1 failed
  GitHub API calls: 199

📋 Summary of Actions Performed:
  danielchalmers/AutoTriage#42: labels: +bug, +enhancement
  danielchalmers/AutoTriage#7: comment
  danielchalmers/AutoTriage#15: title change
  danielchalmers/AutoTriage#99: state: completed

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 26, 2025
Copilot AI and others added 3 commits December 26, 2025 18:33
- Create RunStatistics class to track model runs, actions, and counts
- Update Gemini client to return token usage from API responses
- Update GitHub client to track API call count
- Update triage operations to return action details
- Integrate statistics tracking in main run loop
- Display formatted summary at end of run with emojis and colors
- Add comprehensive tests for statistics module

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
- Update RunStatistics to accept and display owner/repo in action summary
- Format action summary as owner/repo#number for clarity
- Update tests to verify the full repository identifier format

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
- Remove unused issueNumber parameter from getActionDetails methods
- Use explicit isFastModel boolean parameter instead of string matching
- Make model type detection more robust and maintainable

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copilot AI changed the title [WIP] Add summary and statistics to end of run Add run statistics and summary output Dec 26, 2025
@danielchalmers danielchalmers marked this pull request as ready for review December 26, 2025 18:43
Copilot AI requested a review from danielchalmers December 26, 2025 18:43
@danielchalmers danielchalmers merged commit 6de8c5e into main Dec 26, 2025
3 checks passed
@danielchalmers danielchalmers deleted the copilot/add-run-summary-statistics branch December 26, 2025 18:51
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.

Add summary/statistics to the end of run

2 participants