Unable to obtain the UsageContent and FinishReason of response.incomplete
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 67/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend-api-design
Research direction
Start by reading FromOpenAIStreamingResponseUpdatesAsync in OpenAIResponsesChatClient and inspect how it handles StreamingResponseIncompleteUpdate compared with other response updates. Trace where UsageContent and FinishReason are collected, then check the related streaming tests. Done means incomplete responses expose both token usage and the termination reason, with tests covering that case.
Written by the indexing model from the issue text.
Description
Description
The FromOpenAIStreamingResponseUpdatesAsync method of the OpenAIResponsesChatClient class, when handling StreamingResponseIncompleteUpdate, does not process the UsageContent and FinishReason fields. This results in the program being unable to obtain the token consumption information for this round and also not knowing why it has ended.
Reproduction Steps
Set MaxOutputTokens to less than 8k, and set ReasoningEffort to High or above. Let the LLM execute a complex task. At this point, due to insufficient output budget, it will return a message of type response.incomplete, which is of the StreamingResponseIncompleteUpdate type.
Expected behavior
Collect the token usage and the reasons for termination in cases where the task is not completed as expected.
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
- Microsoft.Extensions.AI 10.11.0
Other information
No response
- Dominant language
- C#
- Stars
- 3.3k
- Forks
- 916
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 41
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/extensions
-
AI Chat Web template: scaffolded Identity pages are inaccessible because App.razor applies an interactive render mode unconditionallyPossibly taken @valkiara claimed this today. Openarea-ai-templates untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/extensions#7889 · 1 comment ·
Maintainers usually reply within 1 day
-
HTTP logging truncates catch-all route parameters in the formatted request pathPossibly taken @johnkaram02 claimed this 5 days ago. Openarea-telemetry untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7883 ·
Maintainers usually reply within 1 day
-
Managed DNS resolver ignores tab-separated nameserver lines in /etc/resolv.confPossibly taken @johnkaram02 claimed this 5 days ago. Openneeds-area-label untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7881 ·
Maintainers usually reply within 1 day
-
[Microsoft.Extensions.AI.OpenAI] AsOpenAIStreamingChatCompletionUpdatesAsync writes finish_reason "stop" on every chunk with a null FinishReasonPossibly taken @nurullahturkoglu claimed this 8 days ago. Openarea-ai untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/extensions#7863 ·
Maintainers usually reply within 1 day
-
Outgoing HttpClient LatencyInfo enricher value has incomplete escapingPossibly taken @zjdangge claimed this 9 days ago. Openarea-telemetry untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7757 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dotnet/extensions
Similar issues
-
bug 優先: 低
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
unoplatform/uno#25807 ·
Maintainers usually reply within 1 day