Skip to content

fix(provider): dedupe streaming usage reports#145

Merged
Vizards merged 1 commit into
mainfrom
fix/stream-usage-log-spam
Jun 8, 2026
Merged

fix(provider): dedupe streaming usage reports#145
Vizards merged 1 commit into
mainfrom
fix/stream-usage-log-spam

Conversation

@Vizards

@Vizards Vizards commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Dedupe streaming usage emissions in the SSE client and forward only the final usage payload.
  • Keep downstream usage reporting simple while avoiding SiliconFlow per-chunk output log spam.
  • Guard VS Code usage data reporting so a rejected data part does not block replay marker or cache diagnostics.

Fixes #134

Test plan

  • npm run compile
  • npm run lint
  • npm run format:check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves streaming behavior in the DeepSeek SSE client by deduplicating per-chunk usage emissions (forwarding only the final usage payload) and hardening downstream VS Code usage reporting so failures don’t disrupt replay marker reporting or cache diagnostics.

Changes:

  • Accumulate usage during SSE streaming and emit it once at stream completion ([DONE] or EOF).
  • Wrap VS Code LanguageModelDataPart usage reporting in a try/catch and log failures with request context.
  • Thread requestKind through usage reporting to keep logging consistent with existing request-scoped logs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/provider/stream.ts Guards Copilot usage data part reporting so exceptions don’t block replay markers/diagnostics; logs failures with requestKind.
src/client/core.ts Dedupes streaming usage reports by retaining only the latest usage and emitting it once when the stream completes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Vizards Vizards merged commit b3cbdfa into main Jun 8, 2026
2 checks passed
@Vizards Vizards deleted the fix/stream-usage-log-spam branch June 8, 2026 07: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.

DeepSeek 好慢啊

2 participants