Skip to content

processStreamedMessage doesn't handle reasoning events; Shell.Messages skips reasoning role #414

@rabisg

Description

@rabisg

Problem
@ag-ui/core fully defines the ReasoningMessage type and the REASONING_MESSAGE_START / REASONING_MESSAGE_CONTENT / REASONING_MESSAGE_END event sequence, but neither @openuidev/react-headless nor @openuidev/react-ui consume them. The result is that reasoning/thinking output is silently dropped end-to-end:

  1. processStreamedMessage ignores all reasoning events
    The switch in processStreamedMessage.js only handles TEXT_MESSAGE_CONTENT, TOOL_CALL_START, TOOL_CALL_ARGS, TEXT_MESSAGE_START, and RUN_ERROR. REASONING_MESSAGE_START/CONTENT/END fall through with no effect, so thinking tokens are never written to any message state.

  2. Shell.Messages skips reasoning role messages
    Even if reasoning messages were injected into the messages array (e.g. via loadThread), Shell.Messages explicitly returns null for them:

"Other roles (system, developer, reasoning, activity) — skip by default"

  1. AssistantMessage type has no reasoning field
    There is nowhere in the AG-UI AssistantMessage shape to attach reasoning content, so it can't be co-located with the assistant turn for rendering in something like a BehindTheScenes section.

Expected behavior
OpenUI should show the reasoning content similar to how other AI clients do

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions