OpenCode: ProviderInitError

OpenCode couldn't initialise a provider. The exact message, why OpenCode prints it, and the fix.

Updated November 23, 2026

The message

ProviderInitError

What it means

OpenCode couldn’t initialise a provider. Its own docs point at invalid or corrupted configuration; reports also trace it to provider npm packages that failed to install into ~/.cache/opencode, for example behind a corporate registry.

Fix

  1. Check the provider’s setup against OpenCode’s providers guide (https://opencode.ai/docs/providers).
  2. Clear the provider package cache, rm -rf ~/.cache/opencode, and restart so OpenCode reinstalls the provider packages.
  3. If it persists, clear stored configuration, rm -rf ~/.local/share/opencode (on Windows %USERPROFILE%.local\share\opencode), and re-authenticate with /connect.
  4. On OpenCode 2 the same failure reads ‘Failed to initialize provider "<id>". Check credentials and configuration.’

In an EnvHaven workspace

Yes, until OpenCode is signed in once. Sign in once from the workspace’s Launch menu (Sign in, or Set key for an API key); the sign-in stays on the workspace, across restarts and on every device.

Where this comes from

From OpenCode’s documentation and issue tracker: