co-mono/packages/ai/src/providers
Mario Zechner fb1fdb6006 Fix orphaned tool calls by inserting synthetic empty results
When a user interrupts a tool call flow (sends a message without providing
tool results), APIs like OpenAI Responses and Anthropic fail because:
- OpenAI requires tool outputs for function calls
- OpenAI requires reasoning items to have their following items
- Anthropic requires non-empty content for error tool results

Instead of filtering out orphaned tool calls (which breaks thinking signatures),
we now insert synthetic empty tool results with isError: true and content
'No result provided'. This preserves the conversation structure and satisfies
all API requirements.
2025-12-20 21:34:19 +01:00
..
anthropic.ts fix(ai): re-enable SDK retries for Anthropic provider 2025-12-20 09:56:11 +01:00
google-gemini-cli.ts Fix token counts in google-gemini-cli.ts for anthropic models. 2025-12-20 21:34:18 +01:00
google-shared.ts Add Google Gemini CLI and Antigravity OAuth providers 2025-12-20 21:34:18 +01:00
google.ts feat(ai): add Google Cloud Code Assist provider 2025-12-20 10:20:30 +01:00
openai-completions.ts fix: preserve Gemini thought signatures for tool calls 2025-12-20 07:12:37 -08:00
openai-responses.ts Add Google Gemini CLI and Antigravity OAuth providers 2025-12-20 21:34:18 +01:00
transorm-messages.ts Fix orphaned tool calls by inserting synthetic empty results 2025-12-20 21:34:19 +01:00