fix: deepseek-reasoner test failure and missing nginx /api proxy#704
Open
qirobot wants to merge 1 commit into
Open
fix: deepseek-reasoner test failure and missing nginx /api proxy#704qirobot wants to merge 1 commit into
qirobot wants to merge 1 commit into
Conversation
1. _test_deepseek_api: bump max_tokens 50→2000, timeout 10→120s. deepseek-reasoner emits reasoning_content first; the original 50-token cap leaves message.content empty and the test reports "API响应为空"; 10s also routinely cuts off reasoning. 2. _test_google_api: change retired default gemini-2.0-flash-exp to gemini-2.5-flash. The -exp model was a temporary preview and now 404s; gemini-2.0-flash itself is also unavailable to new accounts. 3. _test_anthropic_api: accept model_name; default claude-3-haiku-20240307 is deprecated and 404s. Use current GA claude-haiku-4-5 when caller doesn't pass a model. 4. test_llm_config: route anthropic to _test_anthropic_api. Previously anthropic fell through to the OpenAI-compatible /chat/completions path, which doesn't exist on api.anthropic.com (the real endpoint is /v1/messages with x-api-key + anthropic-version headers). 5. docker/nginx.conf: add `location /api/` proxy to backend:8000. Without it, the SPA's POST /api/* hits the static-file location and nginx returns 405, so login fails with "status code 405". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
84d6f96 to
4cd9420
Compare
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
Two independent fixes hit while bringing up the project via
docker compose:1.
deepseek-reasoner模型测试始终报 "API响应为空"In
app/services/config_service.py::_test_deepseek_api:max_tokenswas50.deepseek-reasonerfirst emitsreasoning_content(思考过程) before the finalcontent. With only 50 tokens the model is still mid-reasoning, sochoices[0].message.contentcomes back empty and the test reports "API响应为空".timeoutwas10s, which is also too tight for reasoner — it routinely thinks for 30–90s.Bumped to
max_tokens=2000andtimeout=120.deepseek-chatis unaffected (small response, well under the new cap).2. Docker 前端登录 405 (Method Not Allowed)
docker/nginx.confhas no/api/rule, so the SPA'sPOST /api/auth/loginfalls through to the static-filelocation /block. nginx then refuses POST on a static route →405. Login is impossible until this is fixed.Added a standard reverse-proxy block:
The
backendhostname matches the service name indocker-compose.yml, so it works out of the box for freshdocker compose upusers.Test plan
deepseek-chat测试仍然通过(回归)deepseek-reasoner测试通过(之前必失败)admin / admin123登录成功(之前 405)