Repository navigation
Add OpenCode Go as an AI provider - #19
atostivint wants to merge 1 commit into
Conversation
Use OpenCode's Go OpenAI-compatible endpoint with a Go or Go Plus API key. Send Dossier's user agent and a stable session header, list models from the public Go catalog, use prompt-based JSON for models that reject response_format, and explain Go's plan and region errors. Adds the OPENCODE_GO enum value and its migration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPZX7ZNzTkR5e8UcKor4pR
|
Thanks for this, and for how thoroughly it's done! I'll pass on adding OC Go as a provider of its own, though, for three reasons:
If you'd like to use it with your own Dossier anyway, OpenAI-compatible should do it:
When a model refuses Closing this for now. Thanks again! |
|
Hey, it kinda sucks because opencode needs a special header when you use their OpenAI compatible API. Go requires x-opencode-session on every request, it's enforced since 09/05 and requests get a 400 without it, so the plain OpenAI compatible setup you suggested won't work for anyone using Dossier. On the privacy side most of their models are ZDR with 0 days retention, regions default to Europe and US, and Global is only something you opt in for DeepSeek (China). I do my own resume with this subscription and never had an issue, and Hermes is on their validated clients list. I read the terms and nothing there limits it to coding work. |
Summary
Adds OpenCode Go as a first-class AI provider.
https://opencode.ai/inference/go/openai/v1/chat/completionswith anoc_sk_...key from the OpenCode Console.Dossier/<version>as the user agent andx-opencode-session; Refine conversations use the application ID as their session./inference/go/v1/models, so the picker works before a key is saved.response_format.glm-5.3-flashas the default model,DOSSIER_AI_PROVIDER=opencode-gosupport, documentation, and tests.Testing
yarn typecheckyarn lintprisma validateThe DB-backed suite was not run because the local Docker engine failed while starting Postgres. The migration follows the existing enum-addition migrations (
MISTRAL,LMSTUDIO).