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

Closed
opened 2026-02-16 17:41:24 -05:00 by yindo · 3 comments
Owner

Originally created by @chindris-mihai-alexandru on GitHub (Dec 22, 2025).

Originally assigned to: @thdxr on GitHub.

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
Originally created by @chindris-mihai-alexandru on GitHub (Dec 22, 2025). Originally assigned to: @thdxr on GitHub. ## 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: ```bash 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](https://github.com/user-attachments/assets/placeholder1) <img width="1416" height="986" alt="Image" src="https://github.com/user-attachments/assets/d3dfa227-cbf9-45fd-a58d-d76c59e8b256" /> ![ZodError](https://github.com/user-attachments/assets/placeholder2) <img width="1647" height="1032" alt="Image" src="https://github.com/user-attachments/assets/c47fb243-41db-4be1-8af1-4bb260538bb7" /> ## Expected Behavior 1. Auto-install should work on Homebrew installs 2. Mistral provider should correctly handle streaming responses
yindo closed this issue 2026-02-16 17:41:24 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2025):

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

  • #5981: All Mistral models fail with ZodError: "finish" expected string, received object

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

@github-actions[bot] commented on GitHub (Dec 22, 2025): This issue might be a duplicate of existing issues. Please check: - #5981: All Mistral models fail with ZodError: "finish" expected string, received object Feel free to ignore if none of these address your specific case.
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Dec 22, 2025):

$ 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"
  }
}
@chindris-mihai-alexandru commented on GitHub (Dec 22, 2025): ```bash $ 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" } } ```
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

yup been trying to fix it but github is having issues

@rekram1-node commented on GitHub (Dec 22, 2025): yup been trying to fix it but github is having issues
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3768