Skip to content

fix(models): classify Responses and Gemini endpoints by prefix - #153

Merged
samueltuyizere merged 2 commits into
routatic:mainfrom
alecchen:fix/zen-endpoint-classification
Aug 25, 2026
Merged

fix(models): classify Responses and Gemini endpoints by prefix#153
samueltuyizere merged 2 commits into
routatic:mainfrom
alecchen:fix/zen-endpoint-classification

Conversation

@alecchen

Copy link
Copy Markdown
Contributor

Summary

The Zen endpoint classifier in internal/models/classifier.go hard-coded individual model IDs for the Responses and Gemini endpoints. Newer models that fall in those families were not listed, so they fell through to the default Chat Completions endpoint and the proxy could not route them correctly.

The OpenCode Zen docs categorize models by endpoint:

  • Responses (/v1/responses): gpt-*, grok-*, muse-spark-*
  • Gemini (/v1/models/{id}): gemini-*
  • Messages (/v1/messages): claude-*, qwen*

Changes

  • internal/models/classifier.goIsResponsesModel and IsGeminiModel now use prefix matching instead of hard-coded ID lists, covering all current and future models in each family (adds grok-*, muse-spark-*, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash-lite, gpt-5.6-*).
  • internal/client/opencode_test.go — corrected grok-build-0.1 (it uses the Responses endpoint, not Chat Completions) and added coverage for the newly covered model families.
  • docs/howto-add-model.md — corrected the claim that adding a model requires zero code changes.

Scope note

This change is Zen-only. The Go provider is intentionally config-driven (wire_format override, see #141) and is not touched here.

Validation

  • make test — all 17 packages pass (race detector)
  • make lint — gofmt + vet clean
  • make lint-strict — golangci-lint: 0 issues
  • Pre-push hook (format, lint, tests, build) — all passed
  • Manual: clean deepseek-v4-flash request returns HTTP 200; the classifier changes verified by unit tests

🤖 Generated with Claude Code

alecchen and others added 2 commits August 24, 2026 23:00
The Zen classifier hard-coded individual model IDs for the Responses and
Gemini endpoints, so newer models (grok-*, muse-spark-*, gemini-3.7-flash,
gemini-3.6-flash, gemini-3.5-flash-lite, gpt-5.6-*) fell through to the
default Chat Completions endpoint and the proxy could not route them.

Switch IsResponsesModel and IsGeminiModel to prefix matching so all current
and future models in each family route to the correct endpoint. Correct the
grok-build-0.1 test expectation (it uses the Responses endpoint) and fix the
howto-add-model.md claim that adding a model requires zero code changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@samueltuyizere
samueltuyizere merged commit 7cf5012 into routatic:main Aug 25, 2026
4 checks passed
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.

2 participants