Installation issues
Command not found: opencode
Command not found: opencode
Permission denied errors
Permission denied errors
Symptoms: Permission errors when installing or running OpenCodeSolution:
Configuration issues
Config file not found
Config file not found
Symptoms: OpenCode doesn’t find your configuration fileSolution:OpenCode looks for configuration in these locations (in order):
./.opencode.json(current directory)$XDG_CONFIG_HOME/opencode/.opencode.json$HOME/.opencode.json
Invalid JSON in config file
Invalid JSON in config file
Symptoms: OpenCode fails to start with JSON parsing errorSolution:Validate your JSON:Common JSON errors:
- 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
Symptoms: Error message about unsupported or unavailable modelSolution:
Check model name
Ensure the model ID is correct. See the quickstart guide for supported models.
Provider and API issues
API key not working
API key not working
Rate limit errors
Rate limit errors
Symptoms: Error messages about rate limits or too many requestsSolution:OpenCode automatically retries rate-limited requests with exponential backoff (up to 8 retries).If you continue to hit rate limits:
- 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
OpenCode respects
Retry-After headers and implements exponential backoff automatically.Connection timeout
Connection timeout
Symptoms: Requests timeout or hang indefinitelySolution:
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
Check provider status pages:
Context length exceeded
Context length exceeded
Symptoms: Error about exceeding maximum context lengthSolution:Options:
-
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
Symptoms: OpenCode can’t find your GitHub Copilot tokenSolution:
See the GitHub Copilot guide for more details.
Copilot token exchange failed
Copilot token exchange failed
Symptoms: Error exchanging GitHub token for Copilot bearer tokenSolution:
- 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
Symptoms: Connection refused to local model endpointSolution:See the self-hosted models guide for more details.
Model doesn't support tool calling
Model doesn't support tool calling
Symptoms: Self-hosted model doesn’t use tools correctlySolution:Not all models support tool/function calling. Use models known to work well:
- 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
Symptoms: Tools like See the shell configuration guide for more details.
npm, python, or custom scripts aren’t foundSolution:Use a login shell to load your PATH:.opencode.json
Environment variables not available
Environment variables not available
Symptoms: Environment variables set in your profile aren’t availableSolution:Ensure variables are exported in your profile:And use a login shell configuration.
~/.bash_profile
Command execution timeout
Command execution timeout
Symptoms: Long-running commands are killedSolution:OpenCode uses a default timeout of 2 minutes for commands. For long-running operations:
- 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
Symptoms: Previous conversations don’t appearSolution:Check the database file exists:If the database is corrupted, you may need to remove it (this will delete all sessions):
Cannot switch sessions
Cannot switch sessions
Symptoms: Session switching (Ctrl+A) doesn’t workSolution:
- 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
Symptoms: OpenCode takes a long time to startSolution:
High memory usage
High memory usage
Symptoms: OpenCode uses excessive memorySolution:
- 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
Symptoms: Responses take a long time to generateSolution:
- 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
Symptoms: OpenCode doesn’t show code errors or warningsSolution:
- 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
Run OpenCode with debug logging:View logs with
Ctrl+LCheck GitHub issues
Search for similar issues:github.com/opencode-ai/opencode/issues
Report a bug
Create a new issue with:
- OpenCode version
- Operating system
- Error messages
- Debug logs
Join the community
Get help from other users and contributors in discussions.