opencode
opencode copied to clipboard
feat: add reasoning middleware
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: