Troubleshooting
Check the Background Service
OpenCode uses a client-server architecture. The TUI connects to a background service that owns sessions, config, plugins, permissions, and tools. If the service is stuck or unhealthy, restart it:
opencode2 service restart
Check its status:
opencode2 service status
Common Issues
TUI shows “Starting background service…” indefinitely
The service may be booting slowly or stuck. Check:
- Run
opencode2 service statusto see the current status - If status is
failed, read the diagnostic message - Run
opencode2 service restartto force recovery
TUI shows “Waiting for background service…”
The service endpoint is unreachable. The TUI will keep retrying. If it persists:
- The owner process may be unresponsive (holding the lock but not responding)
- Run
opencode2 service restartto perform explicit recovery
Gotcha: Never kill the service process manually. The OS lock guarantees one owner, and
service restartverifies process identity before signaling.
Plugin not loading
Check the server log:
opencode2 api get /api/plugin
This lists active plugin IDs. If a plugin is absent:
- Verify the plugin file exists in
.opencode/plugins/or is installed - Check for syntax errors in the plugin module
- One failing package does not prevent other valid packages from loading
Version mismatch after update
The background updater installs a new package, but the running service keeps the old image. A fresh TUI launch activates the update:
- Close existing TUIs
- Run
opencode2again (fresh launch) - The fresh TUI detects the version difference and triggers graceful replacement
Permission denied for .env files
By default, .env files are denied for reads. Allow specific env example files:
{
"permission": {
"read": {
"*": "allow",
"*.env": "deny",
"*.env.*": "deny",
"*.env.example": "allow"
}
}
}
Read Logs
Server logs contain plugin loading, startup, and error information. The log location depends on your platform and is printed during service startup.