Skip to main content
This guide covers common issues, debugging techniques, and solutions for OpenCode problems.

Diagnostic Steps

Before diving into specific issues, gather diagnostic information:
1

Check logs

Log files are your first stop for debugging:
2

Increase log verbosity

Or set persistently:
opencode.json
3

Check version

Ensure you’re on the latest version:
4

Verify storage health

Common Issues

OpenCode Won’t Start

Error:
Cause: Binary not in PATH or installation incomplete.Solutions:
1

Verify installation

2

Reinstall if missing

3

Add to PATH manually

4

Restart terminal

Close and reopen your terminal window.
Error: OpenCode starts then exits within seconds.Debugging:
Common causes:
Symptoms: TUI starts but shows nothing or freezes.Quick fixes:
  1. Force redraw:
    • Press Ctrl+L to redraw screen
  2. Check terminal compatibility:
    If not, set it:
  3. Try different terminal:
    • macOS: iTerm2, Alacritty, or native Terminal.app
    • Linux: gnome-terminal, konsole, alacritty
    • Windows: Windows Terminal, not Command Prompt

Authentication Issues

Error:
Solutions:
1

Verify API key

2

Re-authenticate

3

Check network connectivity

If these fail, check proxy settings (see Network Configuration).
Cause: Key format issue or whitespace.Fix:
Ensure no leading/trailing whitespace:

Model Errors

Error:
Cause: Incorrect model reference format.Solution:Models must be referenced as <providerID>/<modelID>:
List available models:
Common model IDs:
  • openai/gpt-4.1
  • openai/gpt-4.1-mini
  • anthropic/claude-4.5-sonnet
  • openrouter/google/gemini-2.5-flash
Error:
Causes:
  1. Model requires paid subscription
  2. Account doesn’t have access
  3. Model deprecated/renamed
Check access:
Fallback to available model:
opencode.json

Provider Package Issues

Symptoms:
  • API errors mentioning unknown parameters
  • “Unexpected field” errors
  • Sudden failures after provider API updates
Cause: Cached provider packages (OpenAI SDK, Anthropic SDK, etc.) are outdated.Solution:
1

Clear provider cache

2

Restart OpenCode

OpenCode will automatically download the latest provider packages.
3

Verify fix

Check logs for successful package installation:
Provider packages are cached in ~/.cache/opencode to speed up startup. Clear this if you encounter API compatibility issues.

Configuration Issues

Error:
Cause: Corrupted or invalid configuration.Fix:
1

Validate config syntax

2

Reset config

3

Clear cached data

This deletes all sessions and history. Backup first if needed.
4

Re-authenticate

Cause: Config cached or syntax error preventing reload.Solutions:
  1. Restart OpenCode:
  2. Verify config location:
    Config priority:
    1. .opencode/opencode.json (project-specific)
    2. ~/.config/opencode/opencode.json (user-specific)
  3. Validate syntax:

Desktop App Issues

Quick checks:
  1. Fully quit and relaunch:
    • macOS: Cmd+Q, then reopen
    • Windows: Right-click tray icon → Exit, then reopen
  2. Check for error dialog:
    • Click “Restart” button if shown
    • Copy error details for debugging
  3. macOS only - Reload webview:
    • Menu: OpenCode → Reload Webview
    • Helps if UI is blank/frozen
Symptoms: “Connection Failed” dialog on launch.Causes:
  1. Custom server URL is unreachable
  2. Port conflict preventing local server start
  3. Firewall blocking connection
Solutions:
1

Clear custom server URL

From Home screen:
  1. Click server name (with status dot)
  2. Click “Clear” in Default server section
  3. Restart app
2

Remove server config

Edit ~/.config/opencode/opencode.json, remove:
3

Check environment variables

Symptoms: App crashes on launch after installing plugin.Fix: Disable plugins
1

Edit global config

Open:
  • macOS/Linux: ~/.config/opencode/opencode.jsonc
  • Windows: %USERPROFILE%\.config\opencode\opencode.jsonc
Set:
2

Move plugin files

Rename plugin directories:
3

Restart and re-enable one by one

Once app works, re-enable plugins individually to find the culprit.
When: App behaves strangely, plugin install stuck.
Requirements:
  • Notifications enabled in OS settings for OpenCode
  • App window not focused (notifications only show when backgrounded)
Enable notifications:
System Settings → Notifications → OpenCode → Allow Notifications ✓

Linux-Specific Issues

Cause: Missing clipboard utilities.Solution: Install clipboard tools
Verify fix:
Symptoms: Blank window, crashes on Linux with Wayland.Try Wayland flag:
If worse, use X11 session:
  1. Log out
  2. At login screen, select “Ubuntu on Xorg” or “GNOME on Xorg”
  3. Log in and launch OpenCode

Windows-Specific Issues

Error: App opens to blank window (Windows only).Cause: Microsoft Edge WebView2 Runtime not installed.Solution:
1

Download WebView2 Runtime

2

Install the downloaded MSI

Run the installer and follow prompts.
3

Restart OpenCode Desktop

Should now display correctly.
Symptoms: Slow file operations, laggy terminal, high CPU.Recommended: Use WSLSee Windows WSL Guide for optimal Windows setup.WSL provides:
  • 10-20x faster file I/O
  • Better terminal support
  • Native Linux tool compatibility

Advanced Debugging

Enable Debug Logging

Inspect Database

OpenCode uses SQLite for storage:

Network Debugging

Profile Performance

Reset Everything (Last Resort)

This deletes all OpenCode data including sessions, history, and configuration.Backup important sessions before proceeding.

Getting Help

GitHub Issues

Report bugs and request features. Search existing issues first.

Discord Community

Real-time help from the community and maintainers.

Documentation

Comprehensive guides and API references.

Enterprise Support

Priority support for enterprise customers.

When Reporting Issues

Include this information:
Redact sensitive info (API keys, file paths).
  1. Step-by-step instructions to reproduce
  2. Expected behavior
  3. Actual behavior
  4. Screenshots/screencasts if applicable

Preventive Measures

Keep Updated

Run monthly to get latest fixes.

Backup Sessions

Monitor Logs

Check logs after updates:

Test Config Changes

Test config in isolated session:

Next Steps

Server Configuration

Advanced server setup and debugging.

Network Setup

Resolve proxy and certificate issues.

Windows WSL

Fix Windows-specific performance issues.