Skip to content

fix(ai): default image detail on Responses input_image - #59431

Open
wmoss wants to merge 1 commit into
anomalyco:devfrom
wmoss:responses-image-detail
Open

wmoss wants to merge 1 commit into
anomalyco:devfrom
wmoss:responses-image-detail

Conversation

@wmoss

@wmoss wmoss commented Oct 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #59404

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Emit detail: "auto" when no per-model detail is set, matching the OpenAI API default and the field strict upstreams require.
  • Update the affected expectations and recorded request bodies, and cover the default on compaction replay. The cassette changes are request-body only: the recorded request has to match what the client now serializes. Response bodies were not edited; re-recording needs API keys.

How did you verify your code works?

The existing tests

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.


Added by the opencode bot (AI-generated).

Related: #48740

- Emit `detail: "auto"` when no per-model detail is set, matching the OpenAI API default and the field strict upstreams require.
- Update the affected expectations and recorded request bodies, and cover the default on compaction replay.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good. I reproduced #59404 from source on the base branch using the issue's local Responses server, which requires detail on every input_image the way vLLM does. On base, the tool-result image is sent without detail and the run fails with detail: Field required. With this change it is sent with detail: "auto" and the run completes. The changed tests, the full packages/ai/test/provider suite and typecheck:tsc all pass.

The default only applies to input_image: explicit low/high/auto values still pass through, and input_file is left alone, which matches the OpenAI schema. The four recordings only gain "detail":"auto" in their request bodies. They were edited by hand rather than re-recorded, so I couldn't confirm against the live Alibaba and Moonshot endpoints, but it is a standard OpenAI field.

Public API: unchanged.

Related: #48740

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses image parts omit detail, 400 on strict upstreams

1 participant