Skip to content

fix: use extract_content_or_reasoning() for title generation with reasoning models#18643

Open
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/issue-18529-title-reasoning-models
Open

fix: use extract_content_or_reasoning() for title generation with reasoning models#18643
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/issue-18529-title-reasoning-models

Conversation

@Kailigithub

Copy link
Copy Markdown
Contributor

When auxiliary.title_generation uses a reasoning model (MiniMax-M2.7, DeepSeek-R1, Qwen-QwQ, etc.), the auto-generated session title is empty because the code reads response.choices[0].message.content directly — which is None when the model returns content via structured reasoning fields instead of .content.

Fix: Replace the direct .message.content access with the existing extract_content_or_reasoning() helper that already handles reasoning models correctly. This is the same pattern used in session_search_tool.py, web_tools.py, and vision_tools.py.

Changes:

  • Add extract_content_or_reasoning to the import from agent.auxiliary_client
  • Replace response.choices[0].message.content with extract_content_or_reasoning(response)

Verification:

  • py_compile passes
  • All 19 existing title generator tests pass

Closes #18529

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder labels May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: title_generator.py read response.choices[0].message.content directly instead of use extract_content_or_reasoning() to extract <thinking> tag

2 participants