Skip to content

fix: route OpenCode Go models to supported APIs - #12261

Open
costynus wants to merge 2 commits into
aaif-goose:mainfrom
costynus:fix-opencode-go-api-routing
Open

costynus wants to merge 2 commits into
aaif-goose:mainfrom
costynus:fix-opencode-go-api-routing

Conversation

@costynus

Copy link
Copy Markdown
Contributor

Fixes #11980

Summary

  • Route OpenCode Go models to Responses, Messages, or Chat Completions using the existing provider clients.
  • Use a shared API root while preserving model discovery, authentication, session headers, and context limits.
  • Return an explicit error for model names with no known route.

Testing

  • cargo test -p goose --lib providers::opencode_go
  • cargo test -p goose --test opencode_go_provider_test
  • cargo build -p goose-cli
  • cargo clippy --all-targets -- -D warnings
  • CLI smoke test:
./target/debug/goose run \
  --provider opencode_go \
  --model grok-4.6 \
  --text "Reply exactly: OK" \
  --no-profile \
  --max-turns 1 \
  --quiet

Repeated with kimi-k2.6, minimax-m2.7, glm-5.3-flash, and qwen3.8-flash by changing --model; all returned OK

grok-4.5 is advertised by Go’s model catalog, but a live request returned Model is unavailable. its endpoint selection is covered by the HTTP test.

@costynus
costynus requested a review from a team as a code owner September 20, 2026 10:57

This branch has not been deployed

No deployments
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.

OpenCode Go sends some models through an unsupported API format

1 participant