<@U090ER7JPHA> Look at openhands/openhands repo. I...
# slackbot-chatter
m
@nutritious-balloon-65098 Look at openhands/openhands repo. I am using
Qwen3-8B
model and getting this error message:
openai.BadRequestError: Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'param': None, 'message': 'parameter.enable_thinking must be set to false for non-streaming calls', 'type': 'invalid_request_error'}
. Please investigate.
n
I'm on it! can track my progress here.
Perfect! The changes are concise and completely address the user's request. Now I'll provide a final summary: Summary I successfully investigated and fixed the OpenAI BadRequestError with the Qwen3-8B model. Here's what I found and implemented: Root Cause The error
parameter.enable_thinking must be set to false for non-streaming calls
occurred because: 1. Qwen3-8B doesn't support reasoning effort - but thinking parameters were being passed through
completion_kwargs
2. LiteLLM auto-sets enable_thinking=true when it detects thinking parameters, causing OpenAI to reject non-streaming calls Solution Implemented I made targeted changes to `openhands/llm/llm.py`: 1. Filter thinking parameters for unsupported models: Added logic to remove
thinking
,
enable_thinking
, and
reasoning_effort
from
completion_kwargs
when the model doesn't support reasoning effort 2. Explicit enable_thinking=false for non-streaming calls: Added a safety check to explicitly set
enable_thinking=false
when thinking parameters are present in non-streaming calls Test Coverage Added • Model features test: Verifies Qwen3-8B correctly has
supports_reasoning_effort=False
• Parameter filtering test: Confirms thinking parameters are properly filtered while preserving other parameters Verification • ✅ Both new tests pass • ✅ All pre-commit hooks pass (linting, formatting, type checking) • ✅ Changes are minimal and focused on the specific issue • ✅ Fix prevents the BadRequestError while preserving functionality for reasoning-capable models The fix ensures users can have global thinking parameters in their configuration without breaking models like Qwen3-8B that don't support these features. Would you like me to push these changes to a new branch and create a pull request? <sub>View full conversation</sub>