Skip to content

fix(agent): prevent false thinking-exhaustion for non-reasoning models - #7738

Closed
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/thinking-exhaustion-false-positive
Closed

fix(agent): prevent false thinking-exhaustion for non-reasoning models#7738
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/thinking-exhaustion-false-positive

Conversation

@ygd58

@ygd58 ygd58 commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

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_exhausted check fired for any model returning content=None on 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

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
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).
@teknium1

Copy link
Copy Markdown
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!

@teknium1 teknium1 closed this Apr 11, 2026
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).
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.

[Bug]: NVIDIA Build API modle z-ai/glm4.7 returns Thinking Budget Exhausted

2 participants