mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-18 21:02:50 +03:00
The leading system message was read as `typeof content === "string" ? content : ""`, so a Chat-Completions content-part array — valid for `system`, and what every prompt-caching client sends — collapsed the whole system prompt into an empty `instructions`. Upstream accepted the request and reported a normal prompt_tokens count, so the model answered with no instructions at all and nothing in the response said so. Mid-conversation system turns already handled the array shape (#7056); only the first one did not. Reuses buildResponsesTextParts() and joins the text parts, since `instructions` is a string rather than a part array. Co-authored-by: Vadim Zhyvylo <zhyvylo@involve.software>