fix(agent): prevent false thinking-exhaustion for non-reasoning models - #7738
Closed
ygd58 wants to merge 1 commit into
Closed
fix(agent): prevent false thinking-exhaustion for non-reasoning models#7738ygd58 wants to merge 1 commit into
ygd58 wants to merge 1 commit into
Conversation
Models that do not use <think> tags (e.g. GLM-4.7 on NVIDIA Build, minimax) may return content=None or empty string when truncated. The previous _thinking_exhausted check treated any None/empty content as thinking-budget exhaustion, causing these models to always show the 'Thinking Budget Exhausted' error instead of attempting continuation. Fix: gate the exhaustion check on _has_think_tags — only trigger the exhaustion path when the model actually produced reasoning blocks (<think>, <thinking>, <reasoning>, <REASONING_SCRATCHPAD>). Models without think tags now fall through to the normal continuation retry logic (up to 3 attempts). Fixes NousResearch#7729
1 task
teknium1
added a commit
that referenced
this pull request
Apr 11, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR #7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
teknium1
added a commit
that referenced
this pull request
Apr 11, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR #7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
Contributor
|
Merged via PR #7910. Your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks for the thinking-exhaustion fix! |
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
jh1nresh
pushed a commit
to jh1nresh/hermes-agent
that referenced
this pull request
Aug 26, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
The test expected content=None to immediately trigger thinking-exhaustion, but PR NousResearch#7738 correctly gates that check on _has_think_tags. Without think tags, the agent falls through to normal continuation retry (3 attempts).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Closes #7729
Models without think tags (e.g. GLM-4.7 on NVIDIA Build) always showed Thinking Budget Exhausted error when truncated.
Root Cause
The
_thinking_exhaustedcheck fired for any model returningcontent=Noneon truncation, not just reasoning models.Fix
Gate the exhaustion check on
_has_think_tags— only trigger when the model actually produced<think>/<thinking>/<reasoning>blocks. Non-reasoning models now fall through to the normal 3-attempt continuation retry.Fixes #7729