Conversation
…lback handling in LLMRouterService
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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: defaults Review profile: CHILL 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 9b56d45..95de054
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (6)
• surfsense_backend/app/agents/new_chat/chat_deepagent.py
• surfsense_backend/app/agents/new_chat/middleware/safe_summarization.py
• surfsense_backend/app/services/llm_router_service.py
• surfsense_backend/pyproject.toml
• surfsense_backend/uv.lock
• surfsense_web/pnpm-lock.yaml
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR fixes two critical runtime bugs in the agent system: first, it addresses a
TypeErrorcrash in the summarization middleware caused byAIMessageobjects withcontent=None(common with Azure OpenAI gpt-5.x responses through LiteLLM) by wrapping the upstream middleware with a safe version that sanitizes message content before processing; second, it prevents LLM routing failures where requests were incorrectly routed to wrong endpoints (e.g., OpenRouter requests hitting Azure endpoints) by adding provider-aware defaultapi_baseURLs and general-purpose fallback configurations in the LLM router service. The changes also include a LiteLLM version bump from>=1.83.0to>=1.83.4and corresponding lock file updates.⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
surfsense_backend/pyproject.tomlsurfsense_backend/uv.locksurfsense_web/pnpm-lock.yamlsurfsense_backend/app/agents/new_chat/middleware/safe_summarization.pysurfsense_backend/app/agents/new_chat/chat_deepagent.pysurfsense_backend/app/services/llm_router_service.py