Fix: llm health check failing for thinking models#709
Fix: llm health check failing for thinking models#709jfromentrudder wants to merge 1 commit intosrbhr:mainfrom
Conversation
Closes [Bug]: Health checks do not support models with thinking capabilities, such as deepseek-r1 Fixes srbhr#707
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR contains changes to
AnalysisReasoning Content Check (lines 361-365) The new logic correctly handles edge cases where LLM models (like OpenAI's reasoning models) may return empty message = response.choices[0].message
has_reasoning = getattr(message, "reasoning_content", None) or getattr(
message, "thinking", None)
if not has_reasoning:
# Mark as unhealthy only if no reasoning content eitherThis is a valid improvement that prevents false-negative health checks for reasoning-capable models. API Compatibility: No breaking changes detected. The health check response schema remains unchanged. LiteLLM Configuration: The changes are compatible with existing LiteLLM patterns used in the codebase. Other Observations (not in diff)Minor Enhancement Opportunity: When a model responds with reasoning content but empty main content, the health check passes but Files Reviewed (1 file)
|
There was a problem hiding this comment.
No issues found across 1 file
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Health checks now recognize reasoning_content/thinking attributes as valid responses for thinking models like deepseek-r1, preventing false-negative health check failures. Closes #707 Co-Authored-By: jfromentrudder <jfromentrudder@gmail.com>
Closes [Bug]: Health checks do not support models with thinking capabilities, such as deepseek-r1 Fixes #707
Pull Request Title
Fix LLM health check failing for thinking models
Related Issue
Closes #707
Description
copilot:summary
Added checks for reasoning messaging in the health check content. If reasoning is not present, proceed with normal empty content response.
Type
Proposed Changes
Screenshots / Code Snippets (if applicable)
How to Test
Checklist
Additional Information
copilot:walkthrough
Summary by cubic
Fixes LLM health checks for reasoning/thinking models by recognizing reasoning output even when the text field is empty. Prevents false negatives for models like
deepseek-r1.check_llm_healthto acceptreasoning_content/thinkingas a valid response whencontentis empty.error_code: empty_content.Written for commit cbac3a0. Summary will update on new commits.