default to store false for openai use with agent

Merged
TK
8mo ago
+17-14

Why

OpenAI organizations with Zero Data Retention (ZDR) rejects stored responses from the Responses API (store: true is the default when the AI SDK auto selects it). This causes agent runs to fail

What Changed

  • Set openai: { store: false } in providerOptions across generateText / streamText calls: v3AgentHandler.ts (execute + stream), handleDoneToolCall.ts,
  • Simplified the existing Gemini providerOptions — removed the conditional modelId.includes("gemini-3") check and always pass google: { mediaResolution: "MEDIA_RESOLUTION_HIGH" } since non-Google providers ignore it.

Test Plan

  • Run agent in mode with an OpenAI model to confirm no breaking changes

Summary by cubic

Defaulted agent calls to OpenAI to not store responses, preventing failures for Zero Data Retention orgs. Also simplified Gemini options by always sending high media resolution.

  • Bug Fixes

    • Set providerOptions.openai.store to false for agent generateText and streamText calls in v3AgentHandler (execute + stream) and handleDoneToolCall, avoiding Responses API rejections in ZDR orgs.
  • Refactors

    • Always pass google: { mediaResolution: "MEDIA_RESOLUTION_HIGH" } in providerOptions; non-Google providers ignore it. Added a changeset for a patch release of @browserbasehq/stagehand.