Add an OpenCode Go preset, with the x-opencode-session header it requires - #442
Open
rodrigo103 wants to merge 1 commit into
Open
rodrigo103 wants to merge 1 commit into
rodrigo103 wants to merge 1 commit into
Conversation
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.
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
marked this pull request as ready for review
October 3, 2026 05:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-sessionid per conversation, and has errored without one since 2026-09-06:(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
extraHeaderscan — the same mechanism OpenRouter'sX-Titlealready 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/completionsfamily 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
OpenCodeGoPresetTest: the preset carries the session header, and is chat-only.:lib:dictate-core:testDebugUnitTestand:app:testDebugUnitTest --tests "*ProviderListingTest"pass.Deliberately not attempted: hiding the
/messagesand/responsesids 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.