You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenAI-compatible endpoint rejects standard \
efusal\ field and \image_url\ content blocks #43467
The OpenAI-compatible endpoint (OpenCode Go) returns HTTP 400 on messages that conform to the standard OpenAI Chat Completions schema, specifically:
\\ ext
invalid_request_error:
Extra inputs are not permitted,
field: \messages[N].refusal,
value: None
\\
and:
\\ ext
Failed to deserialize the JSON body into the target type:
messages[N]: unknown variant \image_url, expected \ ext
\\
Root cause (analysis)
efusal\ field — the OpenAI SDK automatically attaches
efusal: None\ to every \�ssistant\ message. This is part of the standard OpenAI Chat Completions schema and is accepted by OpenAI's API and most compatible endpoints. The endpoint rejects it because its message deserializer does not permit unknown fields.
\image_url\ content variant — a message \content\ can be either a plain string or an array of content blocks ({"type": "text", "text": ...}\ or {"type": "image_url", "image_url": ...}) per the standard OpenAI multimodal schema. The endpoint models \content\ as an enum with only a \ ext\ variant, so it rejects \image_url\ blocks.
Expected behavior
The endpoint should tolerate the standard OpenAI message schema:
Accept (and ignore) the
efusal\ field on assistant messages.
Support the \image_url\ content-block variant, or at minimum degrade gracefully rather than failing the whole request.
Impact
Standard OpenAI-compatible clients (e.g. GitHub Copilot App BYOK) cannot be used against this endpoint without errors, even though the same request works against the official OpenAI API and other compatible endpoints.
Suggested fix
Relax message deserialization to ignore unknown fields (remove \deny_unknown_fields, or explicitly allow
efusal: Option).
Model \content\ as a string-or-blocks union supporting \ ext\ and \image_url\ variants.
Reproduction
Configure the endpoint as an OpenAI-compatible BYOK provider in a standard client, then send any multi-turn conversation (triggers
efusal) or any message containing an image (triggers \image_url).
If your report covers both issues together (the refusal field + image_url variant), it may still be worth keeping open as a combined tracking issue — but please check whether commenting on or subscribing to the above covers your needs.
Activity
github-actions commentedon Aug 19, 2026
This issue might be a duplicate of existing issues. Please check:
image_url, expectedtext) #40811: Sameunknown variantimage_url, expectedtext`` serde error from the OpenAI-compatible chat completions endpoint rejectingimage_urlcontent parts — identical symptom and root cause.extra inputs are not permitted(strict schema, extra="forbid") #43089: SameExtra inputs are not permittedstrict-schema rejection from the Console Go gateway, which covers the same underlyingextra="forbid"behavior that causes therefusalfield rejection.If your report covers both issues together (the
refusalfield +image_urlvariant), it may still be worth keeping open as a combined tracking issue — but please check whether commenting on or subscribing to the above covers your needs.github-actions commentedon Oct 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.