Installation issues
Command not found: opencode
Command not found: opencode
Permission denied errors
Permission denied errors
Configuration issues
Config file not found
Config file not found
./.opencode.json(current directory)$XDG_CONFIG_HOME/opencode/.opencode.json$HOME/.opencode.json
Invalid JSON in config file
Invalid JSON in config file
- Missing commas between properties
- Trailing commas (not allowed in JSON)
- Unquoted keys or values
- Unclosed brackets or braces
Model not found or unsupported
Model not found or unsupported
Check model name
Provider and API issues
API key not working
API key not working
Rate limit errors
Rate limit errors
- Wait: Rate limits typically reset after a few minutes
- Upgrade: Consider upgrading your API tier
- Reduce load: Use smaller models for simple tasks
- Monitor usage: Check your API usage dashboard
Retry-After headers and implements exponential backoff automatically.Connection timeout
Connection timeout
Check firewall and proxy settings
- Ensure your firewall allows HTTPS traffic
- If behind a corporate proxy, configure proxy settings
- Check VPN isn’t blocking API access
Verify API status
Context length exceeded
Context length exceeded
-
Enable auto-compact (enabled by default):
This automatically summarizes your conversation when approaching the limit..opencode.json
-
Manually compact the session using
Ctrl+K→ “Compact Session” -
Start a new session with
Ctrl+N -
Use a model with a larger context window:
- Claude 4 Sonnet: 200K tokens
- Gemini 2.5: 1M tokens
- GPT-4.1: 128K tokens
GitHub Copilot issues
GitHub token not found
GitHub token not found
Copilot token exchange failed
Copilot token exchange failed
- Ensure Copilot chat is enabled in your GitHub settings
- Verify your Copilot subscription is active
- Check that your GitHub token has Copilot permissions
- Try re-authenticating with the GitHub CLI
Self-hosted model issues
Cannot connect to local endpoint
Cannot connect to local endpoint
Model doesn't support tool calling
Model doesn't support tool calling
- Llama 3.3 70B Instruct
- Qwen 2.5 Coder
- Granite 3.1 (IBM)
- Mistral Large
Shell and command execution issues
Commands not found in shell
Commands not found in shell
npm, python, or custom scripts aren’t foundSolution:Use a login shell to load your PATH:Environment variables not available
Environment variables not available
Command execution timeout
Command execution timeout
- Break down the operation into smaller steps
- Ask OpenCode to run the command with explicit timeout handling
- Consider running the command outside of OpenCode for very long operations
Database and session issues
Database locked error
Database locked error
Session history lost
Session history lost
Cannot switch sessions
Cannot switch sessions
- Ensure you have multiple sessions created
- Try creating a new session with
Ctrl+Nfirst - Check if the database is accessible
- Restart OpenCode
Performance issues
Slow startup time
Slow startup time
High memory usage
High memory usage
- Use models with smaller context windows
- Compact long sessions
- Restart OpenCode periodically
- Check for memory leaks (report as a bug if persistent)
Slow response generation
Slow response generation
- Use faster models (e.g., GPT-4o Mini, Claude Haiku)
- Reduce
maxTokensfor faster responses - Check your network connection
- Consider using a different provider or region
LSP integration issues
LSP server not starting
LSP server not starting
LSP diagnostics not showing
LSP diagnostics not showing
- Ensure the LSP server supports diagnostics
- Check that files are saved (LSP typically works on saved files)
- Verify the language server is properly initialized
- Try restarting OpenCode
Getting help
If you’re still experiencing issues:Enable debug mode
Ctrl+LCheck GitHub issues
Report a bug
- OpenCode version
- Operating system
- Error messages
- Debug logs