Skip to content

Show token use against available context window on Chat message hover #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pierceboggan
Copy link
Contributor

This PR adds support for visualizing current token usage against the model's available context window upon hover on a chat message:
image

This information was already present in the Copilot Chat debug log that is available with "Developer: Show Chat Debug View", but now is more visible and present directly within the chat message.

- Add tokenUsage field to IResultMetadata interface
- Update defaultIntentRequestHandler to store token info in metadata instead of inline markdown
- Enhance chatParticipantRequestHandler to display token usage in response details footer
- Token usage now appears alongside model info (e.g., 'GPT-4o • 0x • 2822/123901 tokens')
- Provides cleaner, structured approach using VS Code's ChatResult.metadata system
…y.tsx

- Revert conversationHistory.tsx to main branch version
- Keep only essential token usage functionality changes
- Removes unnecessary JSX formatting and null coalescing changes
@justschen justschen requested a review from lramos15 August 6, 2025 18:12
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