Summary
Custom catalog models using @ai-sdk/openai can lose the LLM OpenAI providers default store: false behavior. Core resolves these models directly through OpenAIResponses.route, so a continuing Session may replay a prior reasoning item as an item_reference even when encrypted reasoning state is retained locally. If OpenAI no longer resolves that item ID, every later turn can fail with the same HTTP 400.
Root cause
packages/llm/src/providers/openai-options.ts defines and applies the intended OpenAI defaults through the provider facade. packages/core/src/session/runner/model.ts constructs catalog @ai-sdk/openai models from the raw Responses route instead, bypassing those defaults. In packages/llm/src/protocols/openai-responses.ts, store !== false selects provider-stored item_reference replay, so store: undefined takes the stateful path.
Expected behavior
Core-resolved OpenAI Responses catalog models should inherit LLM-owned OpenAI defaults before explicit catalog, model, variant, or request overrides. Custom model IDs should receive semantics from the selected adapter rather than duplicating provider defaults in every application config.
Regression
Add a Core SessionRunnerModel test with a custom @ai-sdk/openai model ID, encrypted reasoning enabled, and no explicit store. Prepare a second-turn request with persisted itemId and reasoningEncryptedContent, then assert the body uses store: false, includes the full encrypted reasoning item, and emits no item_reference. A companion case should prove explicit store: true still overrides the default.
Experiments workaround and production evidence are tracked in anomalyco/experiments#159.
Summary
Custom catalog models using
@ai-sdk/openaican lose the LLM OpenAI providers defaultstore: falsebehavior. Core resolves these models directly throughOpenAIResponses.route, so a continuing Session may replay a prior reasoning item as anitem_referenceeven when encrypted reasoning state is retained locally. If OpenAI no longer resolves that item ID, every later turn can fail with the same HTTP 400.Root cause
packages/llm/src/providers/openai-options.tsdefines and applies the intended OpenAI defaults through the provider facade.packages/core/src/session/runner/model.tsconstructs catalog@ai-sdk/openaimodels from the raw Responses route instead, bypassing those defaults. Inpackages/llm/src/protocols/openai-responses.ts,store !== falseselects provider-storeditem_referencereplay, sostore: undefinedtakes the stateful path.Expected behavior
Core-resolved OpenAI Responses catalog models should inherit LLM-owned OpenAI defaults before explicit catalog, model, variant, or request overrides. Custom model IDs should receive semantics from the selected adapter rather than duplicating provider defaults in every application config.
Regression
Add a Core
SessionRunnerModeltest with a custom@ai-sdk/openaimodel ID, encrypted reasoning enabled, and no explicitstore. Prepare a second-turn request with persisteditemIdandreasoningEncryptedContent, then assert the body usesstore: false, includes the full encrypted reasoning item, and emits noitem_reference. A companion case should prove explicitstore: truestill overrides the default.Experiments workaround and production evidence are tracked in anomalyco/experiments#159.