← all conversations

OpenCode Configuration Error

2026-06-084 turns7,495 charsgpt-5-5
code-configurationjson-validationsyntax-fix

Summary

User asked to fix a malformed JSON configuration file for OpenCode.

Messages

{ "$schema": "https://opencode.ai/config.json", "mcp": { "open-design": { "type": "local", "command": ["/Applications/Open Design.app/Contents/Frameworks/Open Design Helper.app/Contents/MacOS/Open Design Helper", "/Applications/Open Design.app/Contents/Resources/app/prebundled/daemon/daemon-cli.mjs", "mcp"], "enabled": true, "environment": { "OD_DATA_DIR": "/Users/danielkliewer/Library/Application Support/Open Design/namespaces/release-stable/data", "OD_SIDECAR_IPC_PATH": "/tmp/open-design/ipc/release-stable/daemon.sock", "ELECTRON_RUN_AS_NODE": "1" } } }, "disabled_providers": [], "provider": { "ollama": { "name": "Ollama", "npm": "@ai-sdk/openai-compatible", "models": { "qwen3.5:9b": { "name": "qwen3.5:9b" } }, "options": { "baseURL": "http://localhost:11434/v1", "headers": { "num_ctx": "65536" } } } } } { "providers": { "llama-cpp": { "type": "openai-compatible", "baseUrl": "http://localhost:8080", "apiKey": "not-needed" } }, "models": { "gemma-4-12b-it-qat-q4_0": { "provider": "llama-cpp", "model": "gemma-4-12b-it-qat-q4_0" } }, "defaultModel": "gemma-4-12b-it-qat-q4_0" } ,danielkliewer@Daniels-MacBook-Pro-3 objective06 % opencode Error: 4 of 5 requests failed: Unexpected server error. Check server logs for details. Affected startup requests: config.providers, provider.list, app.agents, config.get at pf (/$bunfs/root/chunk-g2e5x2h0.js:467:117) at <anonymous> (/$bunfs/root/chunk-g2e5x2h0.js:467:6191) at processTicksAndRejections (native:7:39)
The error suggests OpenCode is starting, but one or more provider/configuration APIs are failing during initialization: ```text Affected startup requests: - config.providers - provider.list - app.agents - config.get ``` Looking at your configuration, I see a likely issue. You appear to have **two different configuration formats mixed together**: ### Config #1 (OpenCode format) ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { ... } } } ``` ### Config #2 (different format) ```json { "providers": { "llama-cpp": { ... } }, "models": { ... } } ``` OpenCode expects a specific schema. If both are being merged into the same file, `config.providers` can fail because OpenCode is expecting: ```json "provider": {} ``` while the second block uses: ```json "providers": {} ``` which is a different schema entirely. --- ## First thing to check Run: ```bash opencode config ``` or ```bash opencode doctor ``` (if available in your version) and see whether OpenCode can parse the configuration. --- ## Verify Ollama Before troubleshooting OpenCode, verify Ollama is actually serving the OpenAI-compatible API: ```bash curl http://localhost:11434/v1/models ``` Expected: ```json { "data": [...] } ``` If that fails: ```bash ollama serve ``` and retry. --- ## Verify llama.cpp If you're using the second configuration: ```bash curl http://localhost:8080/v1/models ``` Expected: ```json { "data": [...] } ``` If not: ```bash ./llama-server \ -m model.gguf \ --port 8080 ``` --- ## Check Open Design MCP Since you're using: ```json "mcp": { "open-design": { "type": "local", ... } } ``` verify the daemon is actually running. Try: ```bash ls -la "/tmp/open-design/ipc/release-stable/" ``` You should see: ```text daemon.sock ``` If not, Open Design isn't exposing its MCP socket. Also test: ```bash "/Applications/Open Design.app/Contents/Frameworks/Open Design Helper.app/Contents/MacOS/Open Design Helper" ``` and watch for errors. --- ## Check OpenCode logs OpenCode is telling you: ```text Unexpected server error. Check server logs for details. ``` Run: ```bash opencode --debug ``` or: ```bash DEBUG=* opencode ``` Depending on the version: ```bash LOG_LEVEL=debug opencode ``` The actual exception should appear. --- ## Most likely issue My suspicion is that OpenCode is choking on the provider configuration because you're mixing: ```json "provider" ``` and ```json "providers" ``` schemas from two different systems. Try temporarily reducing the config to: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "name": "Ollama", "npm": "@ai-sdk/openai-compatible", "models": { "qwen3.5:9b": { "name": "qwen3.5:9b" } }, "options": { "baseURL": "http://localhost:11434/v1" } } } } ``` Disable MCP entirely: ```json { "$schema": "https://opencode.ai/config.json" } ``` plus the Ollama provider only. If OpenCode starts successfully, then re-enable: 1. Ollama 2. MCP 3. Open Design one at a time. If you tell me: - OpenCode version (`opencode --version`) - Contents of your actual `~/.config/opencode/config.json` - Output of `DEBUG=* opencode` I can usually identify the exact failing startup request pretty quickly.
gpt-5-5
rewrite it to be correct
If your goal is to run OpenCode with a local Open Design MCP server and local models through either Ollama or llama.cpp, the configuration should use a **single schema**. OpenCode's current configuration format uses `providers` and `models`, not the mixed `provider`/`providers` structure shown above. Here is a cleaned-up configuration that should be structurally correct for modern OpenCode: :::writing{variant="document" id="58341"} { "$schema": "https://opencode.ai/config.json", "mcp": { "open-design": { "type": "local", "enabled": true, "command": [ "/Applications/Open Design.app/Contents/Frameworks/Open Design Helper.app/Contents/MacOS/Open Design Helper", "/Applications/Open Design.app/Contents/Resources/app/prebundled/daemon/daemon-cli.mjs", "mcp" ], "environment": { "OD_DATA_DIR": "/Users/danielkliewer/Library/Application Support/Open Design/namespaces/release-stable/data", "OD_SIDECAR_IPC_PATH": "/tmp/open-design/ipc/release-stable/daemon.sock", "ELECTRON_RUN_AS_NODE": "1" } } }, "providers": { "ollama": { "type": "openai-compatible", "baseUrl": "http://localhost:11434/v1", "apiKey": "ollama" }, "llama-cpp": { "type": "openai-compatible", "baseUrl": "http://localhost:8080/v1", "apiKey": "not-needed" } }, "models": { "qwen3.5:9b": { "provider": "ollama", "model": "qwen3.5:9b" }, "gemma-4-12b-it-qat-q4_0": { "provider": "llama-cpp", "model": "gemma-4-12b-it-qat-q4_0" } }, "defaultModel": "qwen3.5:9b" } ::: I would also verify each component independently before launching OpenCode: ```bash curl http://localhost:11434/v1/models ``` ```bash curl http://localhost:8080/v1/models ``` ```bash ls -la "/tmp/open-design/ipc/release-stable/" ``` If OpenCode still fails with: ```text Affected startup requests: config.providers provider.list app.agents config.get ``` then the next thing I would inspect is the exact OpenCode version: ```bash opencode --version ``` because OpenCode has changed its configuration schema multiple times, and the correct config depends on the version you have installed. The version number will tell us whether the issue is the config format itself or the Open Design MCP integration.
gpt-5-5