Add OpenCode Go setup on-ramp#25
Merged
Merged
Conversation
…ed_by to test - Replace fragile v/k/m prefix checks in display_name_from_model_id with generic isalpha+isdigit pattern - Remove slug+URL heuristic from _is_opencode_go_row (was matching stale rows by URL alone); only check generated_by field - Add missing generated_by field to test fixture dict
write_opencode_go_models used to pop customModels/launchModels/launch_models and force-write to 'models', silently migrating the user's schema. A user with only legacy customModels would see their config key replaced and their existing rows re-mapped without warning. Pick the first key the user already has; default to 'models' for new files. The preserved-row logic is unchanged.
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
This adds a small OpenCode Go setup path for codex-shim users:
api_key_env/apiKeyEnvin model settingscodex-shim opencode-go refresh/chat/completionsand/messagesocgo-*entries with the right provider typeWhy
OpenCode Go subscriptions expose useful models through
https://opencode.ai/zen/go/v1, but users currently need to hand-write the codex-shim model config. OpenCode Go also adds and changes models over time, so a static bundled list goes stale.This gives users a one-key refresh flow:
The refresh probes both supported surfaces and writes models as either
generic-chat-completion-apioranthropic, depending on what works for that model.Changes
api_key_env/apiKeyEnvsupport, with literalapi_keyfallback.codex-shim opencode-go refresh.ocgo-*slugs to avoid collisions with other providers.Model-assisted revision notes
api_key_env, the refresh command, live catalog probing,ocgo-*generation, docs, tests, and live smoke validation.ocgo-*rows are not removed by URL/slug heuristics alone.models,customModels,launchModels, orlaunch_models).Testing
Result:
Local smoke:
codex-shim opencode-go refreshagainst the live OpenCode Go catalog.ocgo-*model entries from oneOPENCODE_GO_API_KEY.127.0.0.1:8785with the refreshed settings./v1/responsesrequest through refreshedocgo-qwen3-7-max; it returnedPR1_REFRESH_QWEN_OK.