Maintain a small, secure compatibility layer between OpenCode and custom OpenAI-compatible model servers. Prefer OpenCode-native functionality for built-in providers, authentication, agents, MCP, and model cache refreshes.
- Track the live schema at
https://opencode.ai/config.json. - Never persist raw API keys, bearer tokens, or private credentials.
- Use
tool_call, not legacy model-leveltools. - Emit
limitonly with bothcontextandoutput. - Preserve unrelated config fields and unknown model/provider metadata.
- Keep launch sync bounded, quiet, and failure-tolerant.
- Keep network discovery opt-in and narrowly scoped.
- Support macOS and Linux, Bash and Zsh.
- Do not shadow server binaries such as
ollamaorvllm.
Run before committing:
npm run validateWhen changing configuration output, add or update an integration test under tests/ that reads the resulting file and verifies secret hygiene and schema-compatible fields.