Skip to content

[Bug] Streaming ignores delta.reasoning_content, so reasoning models stream nothing / yield unparseable output #277

Description

@404-Page-Found

Description

OpenAI-compatible reasoning models (e.g. OpenAI o-series, DeepSeek-R1 via DeepSeek) stream their chain-of-thought in choices[].delta.reasoning_content and may emit content only at the end — or never. parseOpenAiSseLine only reads delta.content (sse.ts:91), so with suggest --stream:

  • The reasoning phase streams no visible text (terminal appears frozen for potentially minutes).
  • For providers/models that only emit reasoning_content, the accumulated string is empty and parseSuggestions() returns nothing → Could not parse any suggestions from LLM response.

Location

src/providers/sse.ts lines 88–100 (parseOpenAiSseLine)

Code

const content = parsed.choices?.[0]?.delta?.content;
if (content) result.text = content;
// delta.reasoning_content is never examined

Suggested fix

Fall back to delta.reasoning_content (optionally with a different chunk kind, or surfaced as text) when content is absent, so the user sees progressive output and parsing has text to work with. Add a unit test using a reasoning_content-only delta stream.

Impact

Broken/blank streaming UX for reasoning models, and hard failures for models that never send content deltas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions