fix(dedaluslabs): Remove tool_choice=auto to avoid 422 error #111
+23
−0
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.
Description
Fix
tool_choice=autocausing HTTP 422 on Dedaluslabs providerDedaluslabs API returns HTTP 422 when
tool_choiceis passed as a string ("auto") instead of an object:This caused LiteLLM's
async_streamingfunction to catch theUnprocessableEntityError, retry twice, then exit the retry loop without returning a value or raising an exception - implicitly returningNone. This resulted in:Since
"auto"is the defaulttool_choicebehavior for OpenAI-compatible APIs, removing it from the request fixes the issue without any functional change.Root cause investigation notes: The issue was traced through multiple layers - initially suspected to be a LiteLLM bug, but hotpatching debug logging into the running container revealed the actual 422 error being silently caught and swallowed by LiteLLM's retry logic.
Testing Done
tool_choice: "auto"as a stringTest trace before fix:
After fix - requests complete successfully.
Checklist
N/A - modifications to existing file only
N/A - internal transform, follows existing pattern
Important
Fixes HTTP 422 error for Dedaluslabs by removing
tool_choice='auto'intransforms.py.tool_choice='auto'for Dedaluslabs in_transform_dedaluslabs_tool_choice()intransforms.pyto prevent HTTP 422 errors.This description was created by
for dda8805. You can customize this summary. It will automatically update as commits are pushed.