react-headless: built-in stream adapters drop reasoning/thinking output instead of emitting `REASONING_*` events
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react, typescript
Research direction
Start in packages/react-headless/src/stream/adapters/ and read how each built-in adapter maps its provider stream to AG-UI events, beginning with the OpenAI Responses and Chat Completions adapters. Check the REASONING_MESSAGE_* event types in @ag-ui/[email protected]. Before writing code, get maintainer answers to the three open questions in the issue, since they decide the event scope and whether reasoning is opt-in. Done means each targeted adapter emits the reasoning events, with a per-adapter fixture test and a patch changeset.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
#414 covers consuming AG-UI reasoning events in processStreamedMessage and rendering them in react-ui (in progress in #594). But the built-in stream adapters in @openuidev/react-headless never produce those events. Each one drops reasoning before it reaches processStreamedMessage:
| Adapter | Reasoning on the wire | What happens today |
|---|---|---|
openAIResponsesAdapter |
response.reasoning_summary_text.delta / .done, response.reasoning_text.delta / .done |
No matching case, ignored |
openAIAdapter (Chat Completions) and openAIReadableStreamAdapter |
delta.reasoning_content (DeepSeek, Qwen, vLLM and other OpenAI-compatible servers), delta.reasoning (OpenRouter) |
Only delta.content and delta.tool_calls are read |
vercelAIAdapter |
reasoning-start / reasoning-delta / reasoning-end UI stream parts |
No matching case, ignored |
langGraphAdapter |
reasoning / thinking content blocks on AI message chunks |
Content blocks are filtered to type === "text" |
So even once #594 lands, only backends that speak AG-UI natively will show reasoning. Anyone using the OpenAI, DeepSeek, OpenRouter, Vercel AI SDK or LangGraph adapters will still see nothing.
Describe the solution you'd like
Map each provider's reasoning stream to the AG-UI events @ag-ui/[email protected] already defines:
REASONING_MESSAGE_STARTwhen reasoning beginsREASONING_MESSAGE_CONTENTfor each deltaREASONING_MESSAGE_ENDwhen reasoning finishes or the first text/tool call arrives
Scope:
- Adapter changes only, in
packages/react-headless/src/stream/adapters/. No changes toprocessStreamedMessage, message types or UI, so this does not overlap with #594. - Until #594 (or another consumer) lands,
processStreamedMessageignores these events, so this is a no-op for existing users. - Unit tests per adapter with hand-crafted stream fixtures, matching the existing adapter tests.
- A changeset for
@openuidev/react-headless(patch).
I'd suggest starting with the OpenAI Responses and Chat Completions adapters, then Vercel AI SDK and LangGraph, either in the same PR or as follow-ups, whichever you prefer.
Describe alternatives you've considered
- Each app writes its own adapter wrapper to translate reasoning. This duplicates provider-specific parsing that the built-in adapters already own.
- Handling provider formats inside
processStreamedMessage. This would break the current split, where adapters normalise to AG-UI andprocessStreamedMessageconsumes AG-UI only.
Additional context
Questions for maintainers:
- Should adapters also emit the outer
REASONING_START/REASONING_ENDpair, or only theREASONING_MESSAGE_*events? - Is reasoning wanted by default, or behind an adapter option (e.g.
openAIAdapter({ reasoning: true })) so existing apps don't receive new events unexpectedly? - One PR for all four adapters, or OpenAI first?
I'd be happy to implement this once the direction is confirmed.
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 698
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 133
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thesysdev/openui
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
thesysdev/openui#1445 · 2 comments ·
Maintainers usually reply within 1 day
-
Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' ruleOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
thesysdev/openui#959 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 18/100
thesysdev/openui#1528 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in thesysdev/openui
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pingdotgg/t3code#30228 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
vfarcic/dot-agent-deck#2079 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
Maintainers usually reply within 1 day