[FEATURE]: support extracting reasoning XML #3952

Closed
opened 2026-02-16 17:42:04 -05:00 by yindo · 1 comment
Owner

Originally created by @snipeship on GitHub (Dec 29, 2025).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Add support for extractReasoningMiddleware() to be able to parse <think> (or other) XML tags so opencode will show the correct Thinking... UI.

Here is how it currently looks like:

Image
Originally created by @snipeship on GitHub (Dec 29, 2025). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Add support for [extractReasoningMiddleware()](https://ai-sdk.dev/docs/reference/ai-sdk-core/extract-reasoning-middleware#extractreasoningmiddleware) to be able to parse `<think>` (or other) XML tags so opencode will show the correct `Thinking...` UI. Here is how it currently looks like: <img width="1728" height="1117" alt="Image" src="https://github.com/user-attachments/assets/532c3a7b-7445-4924-a9d4-cede13c35d60" />
yindo added the discussion label 2026-02-16 17:42:04 -05:00
yindo closed this issue 2026-02-16 17:42:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 29, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2917: Support custom tool parsers - Related to AI SDK middleware support for alternative tool parsing formats
  • #4033: MiniMax M2 tags - Related to rendering thinking/reasoning tags in the UI
  • #3703: Seed-oss-36b reasoning format not supported - Related to extracting reasoning content from different model formats
  • #2875: Have an ability to turn on / off thinking mode - Related to managing thinking/reasoning mode configuration

The core of your request is to use extractReasoningMiddleware() from the AI SDK to properly parse reasoning/thinking XML tags. This is part of a broader feature set around AI SDK middleware support (#2917) and rendering reasoning content in the UI (#4033, #3703).

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 29, 2025): This issue might be a duplicate of existing issues. Please check: - #2917: Support custom tool parsers - Related to AI SDK middleware support for alternative tool parsing formats - #4033: MiniMax M2 <think> tags - Related to rendering thinking/reasoning tags in the UI - #3703: Seed-oss-36b reasoning format not supported - Related to extracting reasoning content from different model formats - #2875: Have an ability to turn on / off thinking mode - Related to managing thinking/reasoning mode configuration The core of your request is to use extractReasoningMiddleware() from the AI SDK to properly parse reasoning/thinking XML tags. This is part of a broader feature set around AI SDK middleware support (#2917) and rendering reasoning content in the UI (#4033, #3703). Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3952