Skip to content

fix: preserve image detail settings and defaults for Open Responses image inputs - #20503

Merged
gr2m merged 3 commits into
mainfrom
bugfix-20300-20260908220406579329
Sep 8, 2026
Merged

gr2m merged 3 commits into
mainfrom
bugfix-20300-20260908220406579329

Conversation

@ai-sdk-factory

@ai-sdk-factory ai-sdk-factory Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Background

Open Responses image requests omitted detail, causing vLLM-compatible endpoints to reject user and tool-output images with HTTP 400.

Root Cause

Both image conversion paths constructed input_image objects without reading the configured provider's imageDetail option or applying the auto default, as confirmed by the reproduction and converter source.

Summary

User and tool-output images now serialize valid explicit detail values and otherwise default to auto. Added a patch changeset and removed reproduction-only artifacts.

Testing

Added regression coverage for default and explicit image detail serialization across inline-data and URL images in user messages and tool outputs.

End-to-end Validation

  • pnpm -C examples/ai-functions exec tsx src/reproduction/open-responses-image-detail-vllm.ts via immutable replay completed successfully without the original HTTP 400 signal.

Related Issues

Fixes #20300

Closes #20464

ai-sdk-factory and others added 3 commits September 8, 2026 22:04
Co-authored-by: Gregor Martynus <[email protected]>
Co-authored-by: vioel <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
Co-authored-by: vioel <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
@ai-sdk-factory

ai-sdk-factory Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

The exact original reproduction completed successfully and the original bug signal did not appear.

Fixes issue

Status: fully-addresses

Both user-message and tool-output image conversions now emit detail, defaulting to auto while preserving valid low, high, or auto provider options for inline-data and URL images.

Side effects

Risk: low

The only production behavior change is adding the specification-defined detail field to image inputs; auto preserves the documented default semantics.

Performance

Risk: low

Each image conversion performs only a constant-time provider-options lookup and three string comparisons, with no additional buffering or retained state.

Backwards compatibility

Risk: low

No stored data is modified or migrated; previously stored prompt parts are only read during serialization and receive the same auto default when no valid detail is present.

Breaking changes

Risk: none

No public exports, types, accepted inputs, errors, configuration, or persisted formats are removed or narrowed; the request payload gains a schema-supported field whose value matches the documented default.

Architecture

Risk: low

The fix remains localized to the Open Responses converter, reuses its existing provider-data lookup, and introduces no dependencies, cross-package source imports, exports, or boundary violations.

Change scope

Status: minimal

The diff contains only the converter fix, focused regression tests, and the required patch changeset.

Security

Risk: low

The change adds no network access, credential handling, parsing, dynamic execution, or unbounded input processing; provider values are restricted to the supported detail literals.

Testing

Status: appropriate

Regression coverage verifies default and explicit detail serialization for user and tool-output images across inline-data and URL forms, and the full package test suites pass in Node and edge environments.

Verification

Inspected the complete three-file diff and related converter, API types, provider configuration, exports, and analogous provider implementations. The Open Responses package passed all 106 tests in both Node and edge environments, package type-checking passed, targeted formatting and lint checks passed, and the diff passed whitespace validation.

Relevant Documentation

@gr2m
gr2m merged commit d127e7a into main Sep 8, 2026
70 checks passed
@gr2m
gr2m deleted the bugfix-20300-20260908220406579329 branch September 8, 2026 22:57
gr2m added a commit that referenced this pull request Sep 8, 2026
…onses image inputs (#20507)

## Background

Open Responses image requests omitted `detail`, causing vLLM-compatible
endpoints to reject user and tool-output images with HTTP 400.

## Root Cause

Both image conversion paths constructed `input_image` objects without
reading the configured provider's `imageDetail` option or applying the
`auto` default, as confirmed by the reproduction and converter source.

## Summary

User and tool-output images now serialize valid explicit detail values
and otherwise default to `auto`. Added a patch changeset and removed
reproduction-only artifacts.

## Testing

Added regression coverage for default and explicit image detail
serialization across inline-data and URL images in user messages and
tool outputs.

## End-to-end Validation

- `pnpm -C examples/ai-functions exec tsx
src/reproduction/open-responses-image-detail-vllm.ts` via immutable
replay completed successfully without the original HTTP 400 signal.

## Related Issues

Fixes #20300

Closes #20494

Backport of #20503

---------

Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
Co-authored-by: ai-sdk-factory <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.95 github npm
@ai-sdk/amazon-bedrock 5.0.79 github npm
@ai-sdk/angular 3.0.95 github npm
@ai-sdk/azure 4.0.66 github npm
@ai-sdk/code-mode 1.0.52 github npm
@ai-sdk/harness 1.0.105 github npm
@ai-sdk/harness-acp 1.0.43 github npm
@ai-sdk/harness-claude-code 1.0.109 github npm
@ai-sdk/harness-cline 1.0.32 github npm
@ai-sdk/harness-codex 1.0.107 github npm
@ai-sdk/harness-cursor 1.0.18 github npm
@ai-sdk/harness-deepagents 1.0.105 github npm
@ai-sdk/harness-fx 1.0.18 github npm
@ai-sdk/harness-github-copilot 1.0.0 github npm
@ai-sdk/harness-grok-build 1.0.42 github npm
@ai-sdk/harness-opencode 1.0.107 github npm
@ai-sdk/harness-pi 1.0.107 github npm
@ai-sdk/langchain 3.0.95 github npm
@ai-sdk/llamaindex 3.0.95 github npm
@ai-sdk/open-responses 2.0.41 github npm
@ai-sdk/openai 4.0.63 github npm
@ai-sdk/otel 1.0.95 github npm
@ai-sdk/policy-opa 1.0.95 github npm
@ai-sdk/react 4.0.98 github npm
@ai-sdk/rsc 3.0.95 github npm
@ai-sdk/sandbox-just-bash 1.0.105 github npm
@ai-sdk/sandbox-vercel 1.0.105 github npm
@ai-sdk/svelte 5.0.95 github npm
@ai-sdk/tui 1.0.96 github npm
@ai-sdk/vue 4.0.95 github npm
@ai-sdk/workflow 2.0.26 github npm
@ai-sdk/workflow-harness 1.0.105 github npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ai-sdk/open-responses omits input_image.detail, causing image requests to fail against vLLM

2 participants