Skip to content

fix(llm): map openai_compat structured output messages like generate - #258

Merged
wolfy-j merged 1 commit into
masterfrom
fix/llm-compat-structured-images
Nov 11, 2026
Merged

wolfy-j merged 1 commit into
masterfrom
fix/llm-compat-structured-images

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Cause

wippy.llm.openai_compat:structured_output put the prompt's messages on the wire unmapped. generate maps them through openai_mapper.map_messages. Because structured output skipped that step, it sent:

  • image parts in the universal {type = "image", source = {...}} shape instead of {type = "image_url", image_url = {url}};
  • developer messages with their role unchanged, instead of as system messages.

OpenAI-compatible servers reject the image shape. vLLM returns:

400 Unsupported chat content part type: 'image'. Supported types: ..., image_url, ... (parameter=type, value=image)

Fix

The handler now maps messages with the driver mapper, the same way generate does. map_messages already drops blank text, so the without_blank_text call and the prompt import are removed.

Tests (red before the fix, green after)

In test/openai_compat/structured_output_test.lua, under Message mapping:

  • sends image parts as image_url content parts: before the fix, expected "image_url", got "image"
  • sends developer messages as system messages: before the fix, expected "system", got "developer"

Full llm suite: 2907 passed, 9 skipped. wippy lint --level error: no issues.

Structured output sent the prompt's messages unmapped, so image parts kept
the universal {type=image, source} shape and developer messages kept their
role. OpenAI-compatible servers reject both (vLLM: "Unsupported chat content
part type: 'image'"). The handler now maps messages with the driver mapper,
as generate does.
@wolfy-j
wolfy-j merged commit f238308 into master Nov 11, 2026
25 checks passed
@wolfy-j
wolfy-j deleted the fix/llm-compat-structured-images branch November 11, 2026 23:11
@wippy-releases wippy-releases Bot mentioned this pull request Nov 11, 2026
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.

1 participant