Skip to content

Fix Claude models routing to Responses API causing not_found_error - #1477

Closed
dajiaohuang wants to merge 2 commits into
usestrix:mainfrom
dajiaohuang:fix/claude-api-route
Closed

dajiaohuang wants to merge 2 commits into
usestrix:mainfrom
dajiaohuang:fix/claude-api-route

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 7, 2026 •

Copy link
Copy Markdown

Withdrawn: the claimed repair is not established on the supported routing path. The original explanation that an unknown catalog entry falls through to Responses was incorrect: an absent entry produces no supported endpoints, and resolve_api_type falls back to chat_completions.

StrixProvider routes anthropic/* through the SDK LiteLLM model provider independently of the SDK-native OpenAI API default set by configure_sdk_api_route. The early return in this patch and its monkeypatched catalog regression therefore do not demonstrate a correction of the Anthropic not_found_error reported in #1369. That report remains unresolved; this closure is not a claim that its error does not exist.

The previous targeted test/Ruff pass at f3a3639 is historical branch coverage, not real provider acceptance. No new tests, builds, runtime, installation, CI runs, or provider requests were performed during this reassessment. Branch and commits are retained.

…ixes usestrix#1369)

resolve_api_type() was checking LiteLLM catalog for /v1/responses support
but falling through to 'responses' for unknown/new models. Models routed
through LiteLLM (non-OpenAI providers like anthropic/*) must always use
chat_completions since /v1/responses is OpenAI-specific. Add an explicit
routes_through_litellm() check before the catalog lookup.
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Changes how models are routed to different API endpoints.

The PR appears safe to merge, with a non-blocking request to test the new routing branch.

Findings

  1. P2 Routing fix lacks a test ▶
Fix with agent prompt
### Issue 1
strix/config/models.py:676-677
No test covers the new early return in `resolve_api_type`. Existing tests check provider detection and OpenAI defaults separately, so removing this guard would leave them passing.

Add a test for `anthropic/claude-sonnet-4-6` with a catalog entry advertising `/v1/responses` and expect `chat_completions`. Also check that an explicit `responses` override still wins.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

resolve_api_type now defaults LiteLLM routes to chat_completions before checking the model catalog.

  • LiteLLM-routed models now use chat completions by default.

Reviews (1) · Last reviewed commit: "Fix Claude models routing to Responses A..." · Reviewed by Greptile

Comment thread strix/config/models.py
Comment on lines +676 to +677
if routes_through_litellm(model_name):
return "chat_completions"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Routing fix lacks a test

No test covers the new early return in resolve_api_type. Existing tests check provider detection and OpenAI defaults separately, so removing this guard would leave them passing.

Add a test for anthropic/claude-sonnet-4-6 with a catalog entry advertising /v1/responses and expect chat_completions. Also check that an explicit responses override still wins.

Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/config/models.py
Line: 676-677

Comment:
**Routing fix lacks a test**

No test covers the new early return in `resolve_api_type`. Existing tests check provider detection and OpenAI defaults separately, so removing this guard would leave them passing.

Add a test for `anthropic/claude-sonnet-4-6` with a catalog entry advertising `/v1/responses` and expect `chat_completions`. Also check that an explicit `responses` override still wins.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

1 participant