Skip to content

fix: handle Qwen models putting response in reasoning_content#84

Open
ihfazhillah wants to merge 1 commit into
anvie:mainfrom
ihfazhillah:fix/qwen-reasoning-content
Open

fix: handle Qwen models putting response in reasoning_content#84
ihfazhillah wants to merge 1 commit into
anvie:mainfrom
ihfazhillah:fix/qwen-reasoning-content

Conversation

@ihfazhillah

@ihfazhillah ihfazhillah commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

When Qwen models run via llama.cpp without --reasoning, they put the entire response in reasoning_content with an empty content field.

This adds a fallback in both llm_loop.py and llm_client.py to treat reasoning_text as the actual response content when:

  • content is empty
  • no embedded_final from thinking tags
  • no tool calls were generated

This fixes silent failures where agents using certain Qwen models appear to not respond.

When Qwen models run via llama.cpp without --reasoning, they put the
entire response in reasoning_content with empty content field. Add
fallback in both llm_loop.py and llm_client.py to treat reasoning_text
as the actual response content when content is empty and no tool calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant