Skip to content

Mistral provider fails: auto-install ENOENT + ZodError on streaming responses (Homebrew install) #5997

Closed as duplicate

Description

Environment

  • opencode version: 1.0.184 (Homebrew on macOS ARM64)
  • Model: devstral-2 (Mistral provider)

Issue 1: Auto-install of @ai-sdk/mistral fails (ENOENT)

When selecting a Mistral model, opencode tries to auto-install @ai-sdk/mistral but fails with:

ENOENT: no such file or directory, posix_spawn '/opt/homebrew/Cellar/opencode/1.0.128/libexec/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode'

The binary path opencode-darwin-arm64/bin/opencode doesn't exist in the Homebrew installation layout.

Workaround: Manually install the SDK:

cd /opt/homebrew/Cellar/opencode/1.0.184/libexec && npm install @ai-sdk/mistral

Issue 2: ZodError after SDK is installed

Even after manually installing @ai-sdk/mistral, using the Mistral model produces ZodError validation failures:

ZodError: [
  {
    "expected": "string",
    "code": "invalid_type",
    "path": ["finish"],
    "message": "Invalid input: expected string, received object"
  },
  {
    "expected": "object",
    "code": "invalid_type",
    "path": ["part"],
    "message": "Invalid input: expected object, received undefined"
  },
  {
    "expected": "string",
    "code": "invalid_type",
    "path": ["delta"],
    "message": "Invalid input: expected string, received undefined"
  }
  ...
]

This suggests @ai-sdk/mistral is not correctly parsing Mistral's streaming response format.

Screenshots

ENOENT error
Image

ZodError
Image

Expected Behavior

  1. Auto-install should work on Homebrew installs
  2. Mistral provider should correctly handle streaming responses

Activity

  1. github-actions commented on Dec 22, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. chindris-mihai-alexandru commented on Dec 22, 2025

    @chindris-mihai-alexandru
    Author
    $ cat ~/.cache/opencode/package.json
    {
      "dependencies": {
        "opencode-gemini-auth": "1.3.6",
        "opencode-copilot-auth": "0.0.9",
        "opencode-anthropic-auth": "0.0.5",
        "@ai-sdk/mistral": "3.0.0"
      }
    }
  3. rekram1-node commented on Dec 22, 2025

    @rekram1-node
    Contributor

    yup been trying to fix it but github is having issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions