Description
In packages/ai/src/providers/openai-responses.ts, if the model returns a refusal payload during a tool call chunk (common in gpt-4o strict tool usage), the adapter ignores the refusal and attempts to parse the tool call as empty JSON, resulting in a JSON parse error instead of a handled ModelRefusalError.
Impact
Agent halts abruptly with a cryptic JSON parsing stack trace instead of gracefully falling back or informing the user of the refusal.
Location
packages/ai/src/providers/openai-responses.ts
Description
In
packages/ai/src/providers/openai-responses.ts, if the model returns arefusalpayload during a tool call chunk (common in gpt-4o strict tool usage), the adapter ignores the refusal and attempts to parse the tool call as empty JSON, resulting in a JSON parse error instead of a handledModelRefusalError.Impact
Agent halts abruptly with a cryptic JSON parsing stack trace instead of gracefully falling back or informing the user of the refusal.
Location
packages/ai/src/providers/openai-responses.ts