Skip to content

feat(ai): add OpenCode Go provider - #810

Open
ofyyyo wants to merge 1 commit into
codedogQBY:mainfrom
ofyyyo:feat/opencode-go-provider
Open

ofyyyo wants to merge 1 commit into
codedogQBY:mainfrom
ofyyyo:feat/opencode-go-provider

Conversation

@ofyyyo

@ofyyyo ofyyyo commented Sep 28, 2026

Copy link
Copy Markdown

Summary

Adds OpenCode Go (https://opencode.ai/zen/go/v1) as an AI provider, following the client requirements of its gateway.

  • Registers the opencode provider in PROVIDER_CONFIGS, the AIProviderType union, and the desktop/mobile provider pickers.
  • Sends a dedicated user-agent: ReadAny/1.0 on OpenCode Go requests instead of the generic SDK/fetch default.
  • Sends a stable x-opencode-session per conversation (the chat thread id) so the gateway can optimize routing and prompt caching.
  • Falls back to a per-request session id for non-conversation requests (connection test, model listing), which OpenCode Go also requires.

Test plan

  • pnpm --filter @readany/core exec vitest run src/ai/__tests__/llm-provider.test.ts — 6 tests, including new header tests
  • Manual: add an OpenCode Go endpoint in Settings → AI, click Test Connection, then chat with a book

- register the opencode provider (https://opencode.ai/zen/go/v1) in provider configs, types and desktop/mobile provider pickers
- identify the client with a ReadAny user agent
- send a stable x-opencode-session per conversation (thread id), falling back to a per-request id for connection tests and model listing

This branch has not been deployed

No deployments
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.

1 participant