Repository navigation
fix: preserve image detail settings and defaults for Open Responses image inputs - #20503
Conversation
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]>
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: 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 effectsRisk: low The only production behavior change is adding the specification-defined detail field to image inputs; auto preserves the documented default semantics. PerformanceRisk: low Each image conversion performs only a constant-time provider-options lookup and three string comparisons, with no additional buffering or retained state. Backwards compatibilityRisk: 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 changesRisk: 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. ArchitectureRisk: 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 scopeStatus: minimal The diff contains only the converter fix, focused regression tests, and the required patch changeset. SecurityRisk: 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. TestingStatus: 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. VerificationInspected 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
|
…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]>
|
🚀 Published in:
|
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_imageobjects without reading the configured provider'simageDetailoption or applying theautodefault, 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.tsvia immutable replay completed successfully without the original HTTP 400 signal.Related Issues
Fixes #20300
Closes #20464