Skip to content

Add an OpenCode Go preset, with the x-opencode-session header it requires - #442

Open
rodrigo103 wants to merge 1 commit into
DevEmperor:mainfrom
rodrigo103:feat/opencode-go
Open

rodrigo103 wants to merge 1 commit into
DevEmperor:mainfrom
rodrigo103:feat/opencode-go

Conversation

@rodrigo103

@rodrigo103 rodrigo103 commented Oct 3, 2026 •

Copy link
Copy Markdown

What

Adds an OpenCode Go preset (opencode.ai/zen/go) to the provider registry: chat-only, dynamic models, curated defaults, session header included.

Why a preset and not "Add your own server"

Since 2026-09-03 Go requires every request to carry a stable x-opencode-session id per conversation, and has errored without one since 2026-09-06:

request is missing x-opencode-session and cannot be routed efficiently

(reported from the app against a live Go key, 2026-10-03). A user-defined endpoint cannot set headers in this app, but a preset's extraHeaders can — the same mechanism OpenRouter's X-Title already uses, so the id lives there. A keyboard sends single-shot rewrites rather than a conversation, so one fixed, stable id is the honest reading of "stable" and gives routing/caching a consistent key; it is the same shape of key the third-party proxies of this service inject.

Models

Curated ids were read off the live catalog (GET /zen/go/v1/models) and Go's endpoint table, both on 2026-10-03, restricted to the /chat/completions family the client speaks. The catalog also lists /messages (MiniMax, Qwen Max/Flash, Qwen Plus) and /responses (Grok, GPT Lunas, Muse Spark) models that would fail through this client. The live catalog is still merged on top, so newer chat models need no app update.

Verification

  • New unit test OpenCodeGoPresetTest: the preset carries the session header, and is chat-only.
  • :lib:dictate-core:testDebugUnitTest and :app:testDebugUnitTest --tests "*ProviderListingTest" pass.
  • End-to-end verified with a real subscription key: this branch was built, installed on a Galaxy Z Fold4 (Android 16), and rewording through the preset works. (For the record, the endpoint's auth check precedes the session check — four unauthenticated probes with and without the header all answer 401 auth errors — so this had to be proven with a live key.)

Deliberately not attempted: hiding the /messages and /responses ids from the fetched picker list. The catalog carries no endpoint information, and guessing abilities from names is what #313 removed — happy to add a mechanism if you want one.

OpenCode Go (opencode.ai/zen/go) is the OpenCode project's chat-only gateway to a curated set of open coding models, and since 2026-09-03 it refuses requests that do not carry a stable x-opencode-session id. The app's own endpoints have no header field, but a preset's extraHeaders do, so the id lives there with a fixed value.

Curated model ids were read off the live catalog and the documented endpoint table on 2026-10-03, restricted to the /chat/completions family; the /messages and /responses siblings share the catalog but not this client. The live catalog is merged on top as usual.
@rodrigo103

Copy link
Copy Markdown
Author

Live verification done: built this branch, installed it on a Galaxy Z Fold4 (Android 16), configured the preset with a real OpenCode Go key — rewording works first try. Marking ready for review.

@rodrigo103
rodrigo103 marked this pull request as ready for review October 3, 2026 05:26
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