Skip to content

fix(cli): Defer shading of gap after tool call in reasoning - #882

Merged
JeanMertz merged 4 commits into
mainfrom
hidden-reasoning-background
Jul 27, 2026
Merged

fix(cli): Defer shading of gap after tool call in reasoning#882
JeanMertz merged 4 commits into
mainfrom
hidden-reasoning-background

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

The blank line after tool chrome that resumes a shaded reasoning region was shaded immediately, based only on whether the next chunk was reasoning. When that chunk turned out to be whitespace-only (or already truncated), it rendered nothing, so the gap actually landed between the tool chrome and the following message or tool call, but still carried the reasoning background. This produced a shaded blank line outside the reasoning region.

The gap is now deferred the same way a reasoning block defers its own trailing separator: it is only resolved, and only then shaded or left plain, once the content that actually follows is known.

The blank line after tool chrome that resumes a shaded reasoning
region was shaded immediately, based only on whether the next chunk
was reasoning. When that chunk turned out to be whitespace-only (or
already truncated), it rendered nothing, so the gap actually landed
between the tool chrome and the following message or tool call, but
still carried the reasoning background. This produced a shaded blank
line outside the reasoning region.

The gap is now deferred the same way a reasoning block defers its own
trailing separator: it is only resolved, and only then shaded or left
plain, once the content that actually follows is known.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit 9f176c0 into main Jul 27, 2026
16 checks passed
@JeanMertz
JeanMertz deleted the hidden-reasoning-background branch July 27, 2026 10:07
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.

1 participant