feat(provider): add OpenCode Free -- keyless public-tier provider#128
Merged
Conversation
…onal key field in AddProviderModal
…n, and provider note exposure
Owner
|
Merged into dev and released in v2.7.19 — thanks! The Zen endpoints checked out against OpenCode's official docs/source. Stacked fixes (3932acb): restored the pre-existing header precedence in openai-chat (registry staticHeaders still flow via derive), fixed the unused |
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 OpenCode Free (opencode-free) as a new provider, giving users access to opencode.ai public bearer-token tier without any API key.
How it works
opencode.ai exposes a public desktop tier authenticated with Authorization: Bearer public and x-opencode-client: desktop -- the same credentials their own desktop app sends.
Infrastructure: staticHeaders on registry entries
Adds a staticHeaders field to ProviderRegistryEntry propagated as provider.headers. Also fixes merge order in createOpenAIChatAdapter so static headers apply first and a user-supplied apiKey can override them.
GUI: Free badge + optional key field
Tests
9 new unit tests in tests/opencode-free-provider.test.ts: registry shape, staticHeaders propagation, providerConfigSeed, key-login map presence, featured list, no-key request headers, user-key override, note content, and deriveProviderPresets keyOptional exposure. All 9 tests pass.
Risk
Low. The staticHeaders mechanism is additive; no existing provider uses it. The public tier may be rate-limited or revoked by opencode.ai at any time.