Skip to content

reasoning-budget: do not re-fire the intro message in once mode - #8

Merged
dzannotti merged 1 commit into
halo-box:masterfrom
voidsurfer:fix/reasoning-intro-once
Aug 29, 2026
Merged

dzannotti merged 1 commit into
halo-box:masterfrom
voidsurfer:fix/reasoning-intro-once

Conversation

@voidsurfer

Copy link
Copy Markdown
Collaborator

The intro message forced at reasoning-block start re-fires for every new block in the same request because the sampler never consumes the intro token list. With --reasoning-budget-intro-mode once this pollutes the chain of thought on multi-block agent turns. The mode previously only affected the server-side prompt scan.

Adds an intro_once flag to the sampler (set when the mode is once); the intro list is cleared once it has fired, so the message appears at most once per request. Mode every keeps the per-block behavior (existing test unchanged) and a regression test covers the once-mode case.

Verified: test-reasoning-budget (24 cases incl. new one) and test-chat pass on a Vulkan Release build.

AI usage disclosure: implemented with AI assistance (GLM, Assisted-by trailer on the commit); reviewed and tested by the submitter.

The sampler re-entered INTRO_FORCING for every new reasoning block because the intro token list was never consumed. Add an intro_once flag (set by the server when --reasoning-budget-intro-mode is once) that clears the list after the intro completes, so the message fires at most once per request. Mode every keeps the previous per-block behavior and its test; add a regression test for once mode.

Assisted-by: zai/glm-5.3-flash
@dzannotti
dzannotti merged commit 21d8483 into halo-box:master Aug 29, 2026
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.

2 participants