Fix: Fixed models returning '404 model not found' when using :THINKING suffix - #1
Closed
stargazer617 wants to merge 9 commits into
Closed
Fix: Fixed models returning '404 model not found' when using :THINKING suffix#1stargazer617 wants to merge 9 commits into
stargazer617 wants to merge 9 commits into
Conversation
stargazer617
marked this pull request as draft
April 19, 2026 10:11
…d in the OpenAI Chat Completions API, the Claude Messages API, and the OpenAI Responses API
stargazer617
marked this pull request as ready for review
April 20, 2026 08:00
Stripping any ":" suffix in resolve_chute_id masks unknown suffixes (e.g. LoRA adapter names) by silently resolving them to the base chute, after which vLLM emits a confusing "LoRA adapter X not found" error. Only strip :THINKING — the one suffix the proxy knows how to handle. Other suffixes are now passed through unchanged so discovery fails with a clear "model not found" error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Equivalent to the previous :sub-based check but reads more naturally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The prefix list, exact-match list, and MiMo-V2-Flash special case mirror chutes-api's invocation router. Hoist them to top-level constants so the coupling is visible at a glance, and add a comment noting that /v1/models exposes a "reasoning" capability but not the per-model default value — which is why we still duplicate the list here. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Standalone LuaJIT tests stub ngx/cjson/resty.http and exercise handle_thinking across 19 scenarios: - :THINKING suffix strip + flag set - X-Enable-Thinking header (true / false / TRUE) - Key normalization (thinking/enable_thinking) - Per-model prefix defaults (GLM-4.7, Kimi-K2.5, DeepSeek-V3.2-Speciale) - Per-model exact defaults (TEE variants) - MiMo-V2-Flash default-off - User overrides (explicit false, :THINKING on MiMo) - Edge cases (mid-string :THINKING, unrelated kwargs preserved) Run with: luajit tests/test_thinking.lua Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR1 follow-up: tighten :THINKING handling, add lua tests
Bringing branch up to date
Contributor
|
Superseded by #2 — moved the :THINKING handling to e2ee_round_trip |
Contributor
|
Opened #2 to supersede this — moved the :THINKING handling to |
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.
Bug
Sending messages to models with the
:THINKINGsuffix returns a 404 model not found error.For example, sending a test message to
zai-org/GLM-5.1-TEE:THINKINGreturns:Status Code:
Response Body:
{ "error": { "message": "model 'zai-org/GLM-5.1-TEE:THINKING' not found", "type": "proxy_error" } }Whereas sending the same message to
zai-org/GLM-5.1-TEEworks as expected.Root Cause
I believe this is because in
e2ee_discovery.lua, the proxy calls:But in the
fetch_model_map()function, the model map is populated from the v1/models endpoint:The v1/models endpoint only returns the models' base names, without any variants or suffixes. For example, for GLM 5.1, the ID is
zai-org/GLM-5.1-TEE. So if we make a request with the modelzai-org/GLM-5.1-TEE:THINKING, theentrywould be null, as the model map only containszai-org/GLM-5.1-TEE, and not the suffixed variant.Then, since
entryis null, this line incheck_confidential():returns
model 'zai-org/GLM-5.1-TEE:THINKING' not found.Fix
This pull request aims to fix this issue by stripping the
:THINKINGsuffix from the model name before looking the model up in the model map.