zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent Panel: Can't talk to Gemini 2.5 Pro over OpenRouter: "Error interacting with language model: data did not match any variant of untagged enum ResponseStreamResult"

Open taoeffect opened this issue 7 months ago • 3 comments

Summary

Image

Tried talking to Gemini 2.5 Pro Preview via OpenRouter and got this. It used to work.

Description

Steps to trigger the problem:

Update your settings to include the following (have Zed setup with OpenRouter per this discussion: https://github.com/zed-industries/zed/discussions/16576 ):

  "language_models": {
    "openai": {
      "api_url": "https://openrouter.ai/api/v1",
      "available_models": [
        {
          "name": "openai/o4-mini",
          "display_name": "o4-mini (OpenRouter)",
          "max_tokens": 200000
        },
        {
          "name": "openai/o4-mini-high",
          "display_name": "o4-mini-high (OpenRouter)",
          "max_tokens": 200000
        },
        {
          "name": "openai/o3",
          "display_name": "o3 (OpenRouter)",
          "max_tokens": 200000
        },
        {
          "name": "openai/gpt-4.5-preview",
          "display_name": "GPT-4.5 (Preview) (OpenRouter)",
          "max_tokens": 128000
        },
        {
          "name": "google/gemini-2.5-pro-preview",
          "display_name": "Gemini 2.5 Pro Preview (OpenRouter)",
          "max_tokens": 1048576
        },
        {
          "name": "anthropic/claude-sonnet-4",
          "display_name": "Claude Sonnet 4 (OpenRouter)",
          "max_tokens": 200000
        },
        {
          "name": "anthropic/claude-sonnet-4:thinking",
          "display_name": "Claude Sonnet 4 Thinking (OpenRouter)",
          "max_tokens": 200000
        },
        {
          "name": "anthropic/claude-opus-4",
          "display_name": "Claude Opus 4 (OpenRouter)",
          "max_tokens": 200000
        }
      ],
      "version": "1"
    }
  },

Actual Behavior:

It thinks for a while (probably charging me credits..) and then gives this error instead of giving any output.

Expected Behavior:

For conversations to work. EDIT: It seems this is a problem just with Gemini 2.5 Pro Preview. Other OpenRouter models, at least o4-mini that I tested, seem to work.

Zed Version and System Specs

Zed: v0.185.10 (Zed) OS: macOS 14.7.3 Memory: 128 GiB Architecture: aarch64

taoeffect avatar May 07 '25 19:05 taoeffect

This doesn't seem like it's a problem with Zed... but with Gemini... I think, so closing this issue for now.

taoeffect avatar May 07 '25 19:05 taoeffect

I experienced this issue a couple of times Claude 4 Sonnet on OpenRouter.

hrefhref avatar May 30 '25 11:05 hrefhref

I'm re-opening this issue because now it's happening to me for o4-mini (but Claude 4 Sonnet works oddly enough..)

More discussion here: https://github.com/zed-industries/zed/discussions/28930

taoeffect avatar May 30 '25 17:05 taoeffect

We have OpenRouter support built-in now, can you also reproduce it there?

Image

bennetbo avatar Jun 17 '25 16:06 bennetbo

No, can't reproduce! 😄

(I also can't find o4-mini (high) in the list, just o4-mini, but that's probably a separate issue).

Thanks for fixing this!!

taoeffect avatar Jun 17 '25 16:06 taoeffect