mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
fix(ai): record provider-returned model in managed openai completions stream (#128324)
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
This commit is contained in:
@@ -421,6 +421,12 @@ export async function processCompletionsStream(
|
||||
notifyLlmRequestActivity(options?.signal);
|
||||
const chunk = rawChunk as OpenAICompatibleChatCompletionChunk;
|
||||
output.responseId ||= chunk.id;
|
||||
// Retain the provider-returned model when it differs from the requested id so
|
||||
// routed/alias responses are not misattributed, matching the direct provider
|
||||
// stream and the anthropic/responses managed transports.
|
||||
if (typeof chunk.model === "string" && chunk.model.length > 0 && chunk.model !== model.id) {
|
||||
output.responseModel ||= chunk.model;
|
||||
}
|
||||
let hasReasoningUsageActivity = false;
|
||||
if (chunk.usage) {
|
||||
output.usage = parseOpenAICompletionsUsage(chunk.usage, model);
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
"provider": "openai",
|
||||
"model": "gpt-5.5",
|
||||
"responseId": "chatcmpl-parity",
|
||||
"responseModel": "gpt-5.5-response",
|
||||
"openclawDelivery": {
|
||||
"textPhaseRequiresTerminal": true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user