Function: ensureToolResultsExist()
ensureToolResultsExist(
messages):ChatMessage[]
Defined in: packages/core/src/segments/derivation.ts:224
Give every tool call a result, injecting a synthetic error for an orphaned one: Anthropic and OpenAI reject a tool call with no matching result.