Skip to content

Add OpenCode Go as an AI provider - #19

Closed
atostivint wants to merge 1 commit into
AienTech:mainfrom
atostivint:feature/add-opencode-go-keys
Closed

atostivint wants to merge 1 commit into
AienTech:mainfrom
atostivint:feature/add-opencode-go-keys

Conversation

@atostivint

Copy link
Copy Markdown

Summary

Adds OpenCode Go as a first-class AI provider.

  • Uses https://opencode.ai/inference/go/openai/v1/chat/completions with an oc_sk_... key from the OpenCode Console.
  • Sends Dossier/<version> as the user agent and x-opencode-session; Refine conversations use the application ID as their session.
  • Lists models from the public Go catalog at /inference/go/v1/models, so the picker works before a key is saved.
  • Uses prompt-based JSON because some Go models reject response_format.
  • Adds clear 403 messages for missing Go/Go Plus plans, region/privacy restrictions, training opt-in, and free-tier models; 429s mention Go plan limits.
  • Adds the settings card with glm-5.3-flash as the default model, DOSSIER_AI_PROVIDER=opencode-go support, documentation, and tests.

Testing

  • yarn typecheck
  • yarn lint
  • prisma validate
  • Targeted Vitest suites: 105 tests pass
  • Confirmed the live public Go models endpoint responds to the exact headers the provider sends

The 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).

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.
pjd-hermes pushed a commit to pjd-hermes/dossier that referenced this pull request Oct 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZX7ZNzTkR5e8UcKor4pR
@AienTech

AienTech commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Privacy. Dossier sends the AI provider someone's whole career history, so I only name providers whose data terms are in their privacy policy or a contract. Go's are in a table in its docs and differ from model to model. OpenCode's privacy policy doesn't mention Go, covers US state laws but not the GDPR, and doesn't name the companies that run the models.
  • What Go is for. According to their own website, OC describes Go as "designed for OpenCode and other coding agents that produce similar types of requests", and monitors its traffic for abuse. Dossier writes resumes and cover letters, and I don't want to point people at a coding plan for that and put their accounts at risk.
  • It's for good. A provider of its own is a database value that installs keep, plus the README, the website and the privacy page to keep in step with Go's plans and limits.

If you'd like to use it with your own Dossier anyway, OpenAI-compatible should do it:

  • Server address: https://opencode.ai/inference/go/openai/v1
  • API key: your OpenCode key
  • Model: type its name if the model list doesn't load from that address.

When a model refuses response_format, Dossier falls back to putting the schema in the prompt by itself. I haven't tried this with Go myself, as I don't have a Go plan.

Closing this for now. Thanks again!

@AienTech AienTech closed this Oct 28, 2026
@atostivint

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants