Skip to content

language_models: Handle usage-only events with empty choices in OpenRouter#50603

Merged
benbrandt merged 1 commit intozed-industries:mainfrom
imumesh18:push-vtzwlurkukrs
Mar 3, 2026
Merged

language_models: Handle usage-only events with empty choices in OpenRouter#50603
benbrandt merged 1 commit intozed-industries:mainfrom
imumesh18:push-vtzwlurkukrs

Conversation

@imumesh18
Copy link
Contributor

@imumesh18 imumesh18 commented Mar 3, 2026

Closes #50569

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Previously, OpenRouter responses containing only usage data (without any
choices) would cause an error. Now the mapper properly emits usage updates
for these events without failing.

Release Notes:

  • Fixed an error when OpenRouter returns a usage-only event with empty choices.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 3, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Mar 3, 2026
@benbrandt benbrandt enabled auto-merge (squash) March 3, 2026 13:52
@SomeoneToIgnore SomeoneToIgnore added the area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Mar 3, 2026
@benbrandt benbrandt merged commit 83fd8fa into zed-industries:main Mar 3, 2026
39 checks passed
@imumesh18 imumesh18 deleted the push-vtzwlurkukrs branch March 3, 2026 14:09
@chawza
Copy link

chawza commented Mar 4, 2026

when will this be released? i encountered this in last two days :(

tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
…outer (zed-industries#50603)

Closes zed-industries#50569

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Previously, OpenRouter responses containing only usage data (without any
choices) would cause an error. Now the mapper properly emits usage
updates
for these events without failing.

Release Notes:

- Fixed an error when OpenRouter returns a usage-only event with empty
choices.
@TeoConan
Copy link

TeoConan commented Mar 4, 2026

I updated Zed to 0.226.4 but I'm still facing this problem

image

Should I open a new issue for it ?
I'm working with Openrouter & Minimax 2.5 on Zed 0.226.4
175cfdc
0.226.4+stable.195.175cfdc40fa202d8baa9ff457ffd1733cd2b5f12

wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
…outer (zed-industries#50603)

Closes zed-industries#50569

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Previously, OpenRouter responses containing only usage data (without any
choices) would cause an error. Now the mapper properly emits usage
updates
for these events without failing.

Release Notes:

- Fixed an error when OpenRouter returns a usage-only event with empty
choices.
@miguilimzero
Copy link

Same for me, no model is working with Zed + OpenRouter at the moment.

@threeequarter
Copy link

when will this be released? i encountered this in last two days :(

https://github.com/zed-industries/zed/releases/tag/v0.227.0-pre

@benbrandt
Copy link
Member

/cherry-pick stable

github-actions bot pushed a commit that referenced this pull request Mar 5, 2026
…outer (#50603)

Closes #50569

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Previously, OpenRouter responses containing only usage data (without any
choices) would cause an error. Now the mapper properly emits usage
updates
for these events without failing.

Release Notes:

- Fixed an error when OpenRouter returns a usage-only event with empty
choices.
zed-zippy bot added a commit that referenced this pull request Mar 5, 2026
…outer (#50603) (cherry-pick to stable) (#50799)

Cherry-pick of #50603 to stable

----
Closes #50569

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Previously, OpenRouter responses containing only usage data (without any
choices) would cause an error. Now the mapper properly emits usage
updates
for these events without failing.

Release Notes:

- Fixed an error when OpenRouter returns a usage-only event with empty
choices.

Co-authored-by: Umesh Yadav <23421535+imumesh18@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Response contained no choices" error, but content is shown (so there was a choice) [OpenRouter]

7 participants