Problem (one or two sentences)
When a persisted conversation contains Anthropic thinking blocks and that history is replayed through the xAI Responses API path, Roo converts the hidden reasoning into ordinary assistant text ([Thinking] ...) instead of preserving or safely dropping it.
Context (who is affected and when)
This affects users who switch providers or resume existing conversations where earlier turns were produced by an Anthropic reasoning model and later turns are sent through the xAI provider.
Reproduction steps
Tested locally on current main at cb83656718.
- Install dependencies in the repo.
- Run the following script from the repo root:
import { convertToResponsesApiInput } from './src/api/transform/responses-api-input'
const messages = [
{
role: 'assistant',
content: [
{ type: 'thinking', thinking: 'SECRET_CHAIN_OF_THOUGHT', signature: 'sig-1' },
{ type: 'text', text: 'visible answer' },
],
},
] as any
console.log(JSON.stringify(convertToResponsesApiInput(messages), null, 2))
- Observe that the transform outputs:
[
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "[Thinking] SECRET_CHAIN_OF_THOUGHT"
}
]
},
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "visible answer"
}
]
}
]
Expected result
Persisted Anthropic thinking blocks should either:
- be dropped for the xAI Responses replay path, or
- be preserved only in a provider-safe/native hidden reasoning format.
They should not be flattened into normal assistant-visible text.
Actual result
thinking is converted into a normal assistant output_text entry prefixed with [Thinking], which changes the semantics of the conversation history and can leak previously hidden reasoning into later prompt context.
Variations tried (optional)
Related local source inspection on current main:
src/core/task/Task.ts:904-924 persists Anthropic reasoning as type: "thinking"
src/api/providers/xai.ts:93-104 routes xAI history through convertToResponsesApiInput(messages)
src/api/transform/responses-api-input.ts:55-63 converts thinking into [Thinking] ... text
App Version
main (cb83656718)
API Provider (optional)
xAI
Model Used (optional)
Grok / xAI Responses path
Roo Code Task Links (optional)
No response
Relevant logs or errors (optional)
This seems best categorized as a provider interoperability / reasoning round-trip bug rather than a general crash. The regression appears adjacent to the xAI Responses migration in #11961 / #11962, but I could not find an existing issue that tracks this exact replay behavior.
Problem (one or two sentences)
When a persisted conversation contains Anthropic
thinkingblocks and that history is replayed through the xAI Responses API path, Roo converts the hidden reasoning into ordinary assistant text ([Thinking] ...) instead of preserving or safely dropping it.Context (who is affected and when)
This affects users who switch providers or resume existing conversations where earlier turns were produced by an Anthropic reasoning model and later turns are sent through the xAI provider.
Reproduction steps
Tested locally on current
mainatcb83656718.[ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "[Thinking] SECRET_CHAIN_OF_THOUGHT" } ] }, { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "visible answer" } ] } ]Expected result
Persisted Anthropic
thinkingblocks should either:They should not be flattened into normal assistant-visible text.
Actual result
thinkingis converted into a normal assistantoutput_textentry prefixed with[Thinking], which changes the semantics of the conversation history and can leak previously hidden reasoning into later prompt context.Variations tried (optional)
Related local source inspection on current
main:src/core/task/Task.ts:904-924persists Anthropic reasoning astype: "thinking"src/api/providers/xai.ts:93-104routes xAI history throughconvertToResponsesApiInput(messages)src/api/transform/responses-api-input.ts:55-63convertsthinkinginto[Thinking] ...textApp Version
main (
cb83656718)API Provider (optional)
xAI
Model Used (optional)
Grok / xAI Responses path
Roo Code Task Links (optional)
No response
Relevant logs or errors (optional)
This seems best categorized as a provider interoperability / reasoning round-trip bug rather than a general crash. The regression appears adjacent to the xAI Responses migration in
#11961/#11962, but I could not find an existing issue that tracks this exact replay behavior.