Skip to content

Conversation

@cuipengfei
Copy link
Contributor

Summary

Replace hardcoded 1+1 token values with real GitHub Copilot API usage data in streaming responses
for agent clients.

Changes

  • Extract actual token counts from chunk.usage instead of hardcoding

Impact

  • Agent clients can now properly track token usage through monitoring tools (e.g.,
    claude-code-leaderboard, ccusage, etc.)

Enables accurate token tracking for agent usage monitoring.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings August 23, 2025 13:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ericc-ch ericc-ch merged commit d60f49c into ericc-ch:master Aug 26, 2025
@ericc-ch
Copy link
Owner

Thank you!

@cuipengfei cuipengfei deleted the fix-token-counting branch October 29, 2025 13:51
hao1939 pushed a commit to hao1939/copilot-api that referenced this pull request Nov 22, 2025
Fix hardcoded token counts in streaming responses
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.

2 participants