Function: stripReasoningFromServingMessages()
stripReasoningFromServingMessages(
messages):boolean
Drop extended-thinking / reasoning blocks from a replayed transcript.
Hybrid Claude endpoints (e.g. Sonnet 4.5+) may emit reasoning content
parts on the first turn. Mastra persists and replays them on the next
agent step, but Databricks-hosted Claude rejects those blocks on
multi-turn tool continuations. The UI already captured reasoning for
display; stripping here keeps provider replay compatible without
changing what users see in the chat bubble.
Parameters
Section titled “Parameters”messages
Section titled “messages”Returns
Section titled “Returns”boolean