Skip to content

language_models: Handle usage-only events with empty choices in OpenRouter (#50603) (cherry-pick to stable)#50799

Merged
zed-zippy[bot] merged 1 commit intov0.226.xfrom
cherry-pick-v0.226.x-83fd8fa4
Mar 5, 2026
Merged

language_models: Handle usage-only events with empty choices in OpenRouter (#50603) (cherry-pick to stable)#50799
zed-zippy[bot] merged 1 commit intov0.226.xfrom
cherry-pick-v0.226.x-83fd8fa4

Conversation

@zed-zippy
Copy link
Contributor

@zed-zippy zed-zippy bot commented Mar 5, 2026

Cherry-pick of #50603 to stable


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.

…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.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 5, 2026
@zed-community-bot zed-community-bot bot added the bot Pull requests authored by a bot label Mar 5, 2026
@zed-zippy zed-zippy bot merged commit 1dd47b1 into v0.226.x Mar 5, 2026
37 checks passed
@zed-zippy zed-zippy bot deleted the cherry-pick-v0.226.x-83fd8fa4 branch March 5, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant