Repository navigation
model-gateway: Add opencode go models support - #752
Open
itsfatodono wants to merge 1 commit into
Open
itsfatodono wants to merge 1 commit into
itsfatodono wants to merge 1 commit into
Conversation
Owner
|
Direction call from Kenny (2026-11-09): yes, OpenCode Go is welcome as a third backend. Thanks for being explicit about what you did and did not verify live. I'm routing this through our review flow this week (same shape as the Antigravity review on #644: default-off state byte-identical, header allowlist, no credential leakage, bounded process sites). I'll add the maintainer fragment ( |
This branch has not been deployed
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.
Summary
Adds OpenCode Go (opencode.ai flat-rate subscription: DeepSeek, GLM, Kimi, Qwen, MiniMax, …) as a third gateway backend next to Codex and Grok.
claude-opencodego-<id>rows are passed through unchanged to Go's Anthropic Messages endpoint. Go translates server-side, so there is no translation layer.login --opencodego, read from stdin and saved to~/.claude/model-gateway/opencode-go-key(0600). No key means no rows and no catalog fetch.x-opencode-session, and strips Claude credentials (header allowlist).doctorgets an OpenCode Go section.context-window --opencodego/--opencodego-compact-atare supported.Live check against a real Go key, through the gateway (DeepSeek V4.1 Flash, same ~10.8k-token prompt three times):
billing_source: goon all three. Not yet verified end to end: streaming and tool loops inside a real Claude Code session.Found while doing this, out of scope: #751 (usage records still target the removed loopback Collector).
Checklist
This PR targets
develop, notmain.I have no board ref and am asking a maintainer to add one. Suggested fragment:
minor,model-gateway, "Add opencode go models support".Agent-facing surfaces updated: model-gateway SKILL.md, remote-control-compatibility SKILL.md, CLI help, refusal and error strings, README, getting-started page.
Verify command run and result:
handleRequest's end callback 73 → 75, resolveGatewaeshModels 10, validateCompactAtSettings 6. Theexisting Codex login body moved unchanged into codexLogin; it has no test coverage, as before.
Negative control
savedContextWindows now guards against a missing backend entry (windows[backend]?.source). Reverting that guard makes
context-window updates validate the backend and the, 1 fail), because a windows object without anopencodego entry throws.
Two things to check before you open it. The live test was just my three non-streaming requests, so I wrote it up that way and listed what's still unverified. The CRAP figures co measurement, not from the repo's own tool.