(details: unknown)
| 326 | const openAiMessages: OpenAI.Chat.ChatCompletionMessageParam[] = [] |
| 327 | |
| 328 | const mapReasoningDetails = (details: unknown): any[] | undefined => { |
| 329 | if (!Array.isArray(details)) { |
| 330 | return undefined |
| 331 | } |
| 332 | |
| 333 | return details.map((detail: any) => { |
| 334 | // Strip `id` from openai-responses-v1 blocks because OpenAI's Responses API |
| 335 | // requires `store: true` to persist reasoning blocks. Since we manage |
| 336 | // conversation state client-side, we don't use `store: true`, and sending |
| 337 | // back the `id` field causes a 404 error. |
| 338 | if (detail?.format === "openai-responses-v1" && detail?.id) { |
| 339 | const { id, ...rest } = detail |
| 340 | return rest |
| 341 | } |
| 342 | return detail |
| 343 | }) |
| 344 | } |
| 345 | |
| 346 | // Use provided normalization function or identity function |
| 347 | const normalizeId = options?.normalizeToolCallId ?? ((id: string) => id) |
no outgoing calls
no test coverage detected