Skip to content

fix: avoid gluing reasoning sentences across deltas#704

Draft
iqdoctor wants to merge 2 commits intoevalstate:mainfrom
strato-space:fix/reasoning-delta-spacing
Draft

fix: avoid gluing reasoning sentences across deltas#704
iqdoctor wants to merge 2 commits intoevalstate:mainfrom
strato-space:fix/reasoning-delta-spacing

Conversation

@iqdoctor
Copy link
Contributor

@iqdoctor iqdoctor commented Mar 6, 2026

Why

Some reasoning streams arrive in sentence-sized deltas.

Example:

  • approach.
  • Specifying session retrieval format

fast-agent currently concatenates them raw, which yields:

  • approach.Specifying ...

That is not a formatting preference issue. It corrupts human-readable reasoning in the console.

Change

Normalize reasoning deltas at the provider boundary.

Rules are intentionally small:

  • insert one space when a new reasoning delta starts a new sentence/token boundary
  • do not insert spaces for call-like fragments such as voice.fetch(...)

This keeps the fix local to reasoning stream assembly and avoids adding heuristics in the UI layer.

Why this shape

Codex-style stream handling is simpler when text is fixed close to the event source.
UI should render, not repair token boundaries.

Validation

  • added focused tests for reasoning delta normalization
  • uv run scripts/lint.py
  • uv run scripts/typecheck.py

@iqdoctor iqdoctor marked this pull request as draft March 6, 2026 16:15
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