← all conversations

JSON Configuration Fix

2026-06-084 turns6,708 charsgpt-5-5
json-configurationdebuggingerror-fixing

Summary

User is troubleshooting JSON configuration errors in a Bun-based application with server request failures and URL parsing issues.

Messages

^[[<35;72;14MError: 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) ------ edit this to be correct: { "$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": { "llamacpp": { "api_base": "http://127.0.0.1:8080", "api_key": "sk-no-key-required", "name": "llamacpp", "npm": "@ai-sdk/openai-compatible", "models": { "gemma-4-12b-it-qat-q4_0": { "name": "gemma-4-12b-it-qat-q4_0" } }, "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" } } } } }
Your JSON has several structural problems: - Missing closing braces for the `llamacpp.models` section. - Missing comma after the `llamacpp` provider. - `provider` may need to be `providers` depending on your OpenCode version. - `api_base` should often be `baseURL` for `@ai-sdk/openai-compatible`. - The nesting is broken, causing the parser to fail before startup. A corrected version would look like: ```json { "$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": { "llamacpp": { "name": "llamacpp", "npm": "@ai-sdk/openai-compatible", "api_base": "http://127.0.0.1:8080", "api_key": "sk-no-key-required", "models": { "gemma-4-12b-it-qat-q4_0": { "name": "gemma-4-12b-it-qat-q4_0" } } }, "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" } } } } } ``` However, the error you're getting: ```text Affected startup requests: config.providers provider.list app.agents config.get ``` usually means **OpenCode successfully parsed the JSON but failed to load providers**, not merely a syntax error. Things I'd check: 1. Verify llama.cpp server is running: ```bash curl http://127.0.0.1:8080/v1/models ``` 2. Verify Ollama is running: ```bash curl http://localhost:11434/api/tags ``` 3. Verify the MCP command exists: ```bash ls -la "/Applications/Open Design.app/Contents/Frameworks/Open Design Helper.app/Contents/MacOS/Open Design Helper" ls -la "/Applications/Open Design.app/Contents/Resources/app/prebundled/daemon/daemon-cli.mjs" ``` 4. Check whether your OpenCode version expects: ```json "providers": { ... } ``` instead of ```json "provider": { ... } ``` Many recent builds use: ```json { "providers": { ... } } ``` If you're still getting the same startup failure, paste: ```bash opencode doctor ``` and ```bash opencode config validate ``` along with the OpenCode version: ```bash opencode --version ``` and I can determine whether it's a schema issue, MCP startup failure, or provider registration problem.
gpt-5-5
"undefined/chat/completions" cannot be parsed as a URL.
The error: ```text "undefined/chat/completions" cannot be parsed as a URL ``` means OpenCode is trying to build an OpenAI-compatible endpoint from a missing base URL. In other words, somewhere in your provider configuration: ```text baseURL = undefined ``` and OpenCode is constructing: ```text undefined/chat/completions ``` instead of something like: ```text http://127.0.0.1:8080/v1/chat/completions ``` or ```text http://localhost:11434/v1/chat/completions ``` ### Most likely cause For `@ai-sdk/openai-compatible`, OpenCode expects the URL inside `options.baseURL`, not `api_base`. Try changing your llama.cpp provider to: ```json { "name": "llamacpp", "npm": "@ai-sdk/openai-compatible", "models": { "gemma-4-12b-it-qat-q4_0": { "name": "gemma-4-12b-it-qat-q4_0" } }, "options": { "baseURL": "http://127.0.0.1:8080/v1", "apiKey": "sk-no-key-required" } } ``` instead of: ```json { "api_base": "http://127.0.0.1:8080", "api_key": "sk-no-key-required" } ``` ### Also check Ollama Make sure it follows the same pattern: ```json { "name": "Ollama", "npm": "@ai-sdk/openai-compatible", "models": { "qwen3.5:9b": { "name": "qwen3.5:9b" } }, "options": { "baseURL": "http://localhost:11434/v1", "apiKey": "ollama" } } ``` ### Verify the endpoints manually For llama.cpp: ```bash curl http://127.0.0.1:8080/v1/models ``` For Ollama: ```bash curl http://localhost:11434/v1/models ``` If either returns JSON, the endpoint is valid. ### Another possibility Some OpenCode versions require: ```json { "providers": { ... } } ``` not: ```json { "provider": { ... } } ``` If OpenCode cannot find the provider definition, it may resolve the URL as `undefined`, producing exactly the error you're seeing. Can you paste the output of: ```bash opencode --version ``` and the complete current `config.json`? The exact schema changed between OpenCode releases, and the version will determine whether the issue is `provider` vs `providers` or the `baseURL` location.
gpt-5-5