Skip to content

Conversation

@snipeship
Copy link
Contributor

@snipeship snipeship commented Dec 29, 2025

Closes #6337, #4033, #3703


Adds a new interleaved object shape to model config with tagName (required) and optional startWithReasoning.
Read ai-sdk's extractReasoningMiddleware() as a reference.

Example config:

"models": {
  "model-name": {
    "reasoning": true,
    "interleaved": {
      "tagName": "think" // or other XML tag
      // "startWithReasoning": true
    },
  }
}

Before (see issue)

After:
Screenshot 2025-12-29 at 10 14 57

@snipeship
Copy link
Contributor Author

@rekram1-node
Copy link
Collaborator

wondering if there is anyway we could avoid additional configs and just always have it on, and then default to handling which should cover 90% of users and they wont have to do configs manually?

@snipeship
Copy link
Contributor Author

wondering if there is anyway we could avoid additional configs and just always have it on, and then default to handling which should cover 90% of users and they wont have to do configs manually?

opened #6463
doesn't close #3703 because of the different thinking tags
guess if there are more users facing this issue (or labs being annoying), we can revisit this solution with some logic from the other PR (on by default, change thinking tags, or disable the middleware through config)

@letsrock85
Copy link

 "models": {
        "minimax": {
          "name": "minimax",
          "tool_call": true,
          "reasoning": true,
          "interleaved": {
            "tagName": "think"
          },
image_2026-01-09_01-43-12

Do I need to pull a specific issue from the repository, or am I missing something?

@snipeship
Copy link
Contributor Author

 "models": {
        "minimax": {
          "name": "minimax",
          "tool_call": true,
          "reasoning": true,
          "interleaved": {
            "tagName": "think"
          },
image_2026-01-09_01-43-12 Do I need to pull a specific issue from the repository, or am I missing something?

it should work by default now on the latest build without adding anything to the config. if for some reason you need custom think tags (looks like you don’t) you can build from source from this branch

@letsrock85
Copy link

I use VS Code opencode extension on Windows, last updated 3 days ago, it throws an error when I add "interleaved": { "tagName": "think" }. " which I need for Opencode to properly parse minimax-m2's tag.
image

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.

[FEATURE]: support extracting reasoning XML

3 participants