Fix llama provider alias in character chat#2586
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoCanonicalize
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
There was a problem hiding this comment.
Code Review
This pull request resolves an issue where the WebUI catalog provider ID llama was not correctly canonicalized to llama.cpp in character chat completions, causing credential errors. The fix applies provider normalization across the chat request schema and the shared provider/model resolver, backed by new unit tests. The review feedback highlights that replacing the original .lower() and .strip() operations with the normalization function could introduce case-sensitivity issues, whitespace bugs, or None type errors, and suggests preserving these defensive string manipulations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Code Review by Qodo
Context used✅ Compliance rules (platform):
74 rules 1.
|
db14254 to
75072c7
Compare
|
Addressed the review feedback and rebased on latest Changes made in the amended PR commit:
Verification after rebase:
All inline review threads are resolved. |
Summary
llamatollama.cppinChatCompletionRequestvalidation./complete-v2routes rawprovider: "llama"through the llama.cpp adapter instead of the missing-credentials path.TASK-12118.Verification
/Users/macbook-dev/Documents/GitHub/tldw_server2/.venv/bin/python -m pytest tldw_Server_API/tests/Chat_NEW/unit/test_chat_schemas.py tldw_Server_API/tests/Chat_NEW/unit/test_provider_model_resolution.py -q/Users/macbook-dev/Documents/GitHub/tldw_server2/.venv/bin/python -m bandit -r tldw_Server_API/app/api/v1/schemas/chat_request_schemas.py tldw_Server_API/app/core/Chat/chat_service.py -f json -o /tmp/bandit_task_12118_pr.jsongit diff --checkPOST /api/v1/chats/{id}/complete-v2?scope_type=globalwithprovider: "llama"returned200 OKtext/event-stream from the configured llama.cpp server.Change summary
AI-authored PR. Per repo policy, a human-authored Change summary explaining what changed and why is required before merge.
Summary by cubic
Fixes character chat provider alias so
llamaresolves tollama.cpp, ensuring/api/v1/chats/{id}/complete-v2uses thellama.cppadapter instead of failing with missing credentials. Addresses TASK-12118.llamatollama.cppinChatCompletionRequestvalidation.provider/model) for character chat.Written for commit 75072c7. Summary will update on new commits.