Skip to content

fix: Streaming reasoning parser buffer phase eating content#8

Merged
raullenchai merged 1 commit intomainfrom
feat/grammar-error-handling
Feb 25, 2026
Merged

fix: Streaming reasoning parser buffer phase eating content#8
raullenchai merged 1 commit intomainfrom
feat/grammar-error-handling

Conversation

@raullenchai
Copy link
Copy Markdown
Owner

Summary

  • Fix streaming reasoning parser emitting all text as reasoning_content during the first 80-char buffer phase
  • With openclaw's reasoning: true config, this caused the model to appear to "forget who it is" — the identity response was hidden in reasoning

Fix

  • Return None during buffering (truly silent) instead of DeltaMessage(reasoning=delta_text)
  • Flush entire accumulated buffer as correct type (content or reasoning) once decision is made
  • Handle finalize_streaming for responses shorter than buffer threshold

Test plan

  • 899 unit tests pass
  • Streaming identity test: reasoning properly separated, full content preserved
  • 5/5 complex tests pass (multi-tool, architecture design, code review, multi-step, cache hit)

🤖 Generated with Claude Code

During the first 80 chars of output, the MiniMax reasoning parser
emitted ALL text as reasoning_content before deciding if it actually
was reasoning. With openclaw's reasoning:true config, this hidden
the model's actual response (e.g., "I am OpenClaw") in the reasoning
block, making it appear the model "forgot who it is."

Fix: return None during buffering (truly silent), then flush the
entire accumulated buffer as the correct type (content or reasoning)
once the decision is made. Also handle finalize_streaming for
responses shorter than the buffer threshold.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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