WeKnora/internal/models
Rene Zander d823ef61ae fix(vlm): use max_completion_tokens for GPT-5 / o-series vision models
The VLM path sent max_tokens and temperature, both rejected by reasoning
and GPT-5 models. go-openai's reasoning validator failed the request
client-side, so every OCR and caption call errored with "this model is
not supported MaxTokens, please use MaxCompletionTokens" and no image
chunk was ever created.

The chat path already solved this in shapeOpenAIReasoning (issue #1283);
the VLM path was never wired to it. Reuse the shared
provider.IsOpenAIReasoningOrGPT5Model predicate so both paths agree on
which models are affected. Migrating max_tokens alone is not enough --
the VLM default temperature of 0.1 is independently rejected.

Also report an empty completion with finish_reason=length as an error.
max_completion_tokens covers reasoning tokens, so an exhausted budget
returns empty content rather than an API error, which was previously
recorded as no_extracted_content and looked identical to an image with
no text.

Fixes #2537

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 08:46:17 +08:00
..
asr fix(security): harden model client redirects 2026-07-02 19:15:46 +08:00
chat refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
embedding fix(embedding): prevent ants worker panic and mutex deadlock on empty/mismatched results 2026-08-04 16:46:57 +08:00
limiter feat(system): expose model concurrency stats on runtime queues dashboard 2026-07-11 07:17:28 +08:00
provider fix(rerank): batch Volcengine rerank requests over API document limit 2026-07-20 20:07:21 +08:00
rerank fix(rerank): normalize NVIDIA logit scores 2026-08-03 15:07:15 +08:00
utils feat: integrate ChatBot provider and docreader 2026-04-13 17:47:24 +08:00
vlm fix(vlm): use max_completion_tokens for GPT-5 / o-series vision models 2026-08-09 08:46:17 +08:00