Conversation
Duplicate of #50397 — same fix in the reasoning-exhaustion exit path of |
tonydwb
left a comment
There was a problem hiding this comment.
LGTM. Clean fix: surfaces reasoning/thinking content as response instead of '(empty)'. 1 file, 9 additions, well-scoped. No issues.
Reviewed by Hermes Agent
1cd8ff1 to
6864a1e
Compare
6864a1e to
299e905
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. The premise is confirmed on current main: agent/conversation_loop.py:5177-5214 extracts reasoning but still terminates with (empty), and tests/run_agent/test_run_agent.py:4424-4444 reproduces that path.
Problems
agent/conversation_loop.py:4895leaves_turn_exit_reasonasempty_response_exhausted. Currentagent/turn_finalizer.py:338-366treats a non-punctuated response of 24 characters or fewer under that reason as a partial fragment and appends the “⚠️ No reply” explainer. Thus a valid short fallback such asYeswould be delivered with a contradictory failure notice. The changed test fixture is 27 characters, so it misses this path.
Suggested changes
- Mark the reasoning fallback as a visible text completion, or explicitly exempt it from the partial-fragment explainer; add a short reasoning-only regression test.
This is an automated hermes-sweeper review.
| # content only via reasoning_content/reasoning_details | ||
| # API fields would otherwise show blank to the user | ||
| # and cause infinite retry loops (#58117). | ||
| final_response = reasoning_text |
There was a problem hiding this comment.
Please also change the terminal reason or exempt this fallback from the completion explainer. On current main, empty_response_exhausted plus a non-punctuated response of 24 characters or fewer makes agent/turn_finalizer.py:338-366 append “Yes would therefore receive a contradictory failure footer.
|
Thanks @tonydwb for the review. @alt-glitch — noted on the duplicate flag. #50397 was filed first and covers the same reasoning-exhaustion exit path. I checked #50397 and it's still open. Closing this one in favour of the earlier PR. |
|
Closing as duplicate of #50397 (filed earlier, same fix in the reasoning-exhaustion exit path). Thanks to @alt-glitch for flagging the overlap. |
Fixes #58117
Description
When a thinking model (e.g. DeepSeek V4 Flash) returns a response where all
content is inside a reasoning/thinking block — or where
contentis emptyand only
reasoning_contentis populated — the agent exhausts its prefilland empty-response retries and eventually sets
final_response = "(empty)".This causes:
produced reasoning content
response is empty, wasting $30-80+ in API costs
Fix
When retries are exhausted and reasoning/thinking content IS available,
surface it as
final_responseinstead of"(empty)". The reasoningtext (from
reasoning_content,reasoning, orreasoning_detailsfields) is the model's actual response — it was just delivered through the
thinking channel rather than visible content.
Verification
agent/conversation_loop.pywith visible content are unchanged