Skip to content

Core catalog OpenAI models skip stateless Responses defaults #33999

Description

@kitlangton

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions