fix: improve VS Code LM token usage reporting for context window updates #6115
+77
−9
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.
This PR fixes issue #6112 where the token count and context length progress bar don't update properly when using VS Code LM API as the API Provider.
The VS Code LM provider was only yielding token usage information once at the end of the stream, which prevented the UI from updating the context window progress bar during streaming.
Changes:
Fixes #6112
Important
Improves token usage reporting in
VsCodeLmHandler
by adding initial and periodic updates during streaming, addressing issue #6112.VsCodeLmHandler
invscode-lm.ts
now yields initial token usage at stream start and periodic updates every 500 characters.vscode-lm.spec.ts
to expect initial, periodic, and final token usage chunks.getApiProtocol
inprovider-settings.test.ts
to return 'openai' forvscode-lm
provider.This description was created by
for 048fcf7. You can customize this summary. It will automatically update as commits are pushed.