{"record":{"id":"3ea153e027bc7ea2","repo":"microsoft/autogen","slug":"varobject-response-varobject-is-not-supported","errorCode":null,"errorMessage":"VarObject {response.VarObject} is not supported","messagePattern":"VarObject (.+?) is not supported","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/AutoGen.Mistral/Middleware/MistralChatMessageConnector.cs","lineNumber":175,"sourceCode":"        }\n        else if (finishReason == Choice.FinishReasonEnum.ToolCalls)\n        {\n            var functionContents = choice.Message?.ToolCalls ?? throw new ArgumentNullException(\"choice.Message.ToolCalls\");\n            var toolCalls = functionContents.Select(f => new ToolCall(f.Function.Name, f.Function.Arguments) { ToolCallId = f.Id }).ToList();\n            return new ToolCallMessage(toolCalls, from: from.Name);\n        }\n        else\n        {\n            throw new NotSupportedException($\"FinishReason {finishReason} is not supported\");\n        }\n    }\n\n    private IMessage? ProcessChatCompletionResponse(IMessage<ChatCompletionResponse> message, IAgent agent)\n    {\n        var response = message.Content;\n        if (response.VarObject != \"chat.completion.chunk\")\n        {\n            throw new NotSupportedException($\"VarObject {response.VarObject} is not supported\");\n        }\n        if (response.Choices is null)\n        {\n            throw new ArgumentNullException(\"response.Choices\");\n        }\n\n        if (response.Choices?.Count != 1)\n        {\n            throw new NotSupportedException(\"response.Choices.Count != 1\");\n        }\n\n        var choice = response.Choices[0];\n        var delta = choice.Delta;\n\n        // process text message if delta.content is not null\n        if (delta?.Content is string content)\n        {\n            return new TextMessageUpdate(role: Role.Assistant, content, from: agent.Name);","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/dotnet/src/AutoGen.Mistral/Middleware/MistralChatMessageConnector.cs#L157-L193","documentation":"NotSupportedException from the streaming path: the connector requires every ChatCompletionResponse chunk to have object == \"chat.completion.chunk\". A chunk with a different object value (commonly \"chat.completion\" when streaming was silently disabled, or an error object) is rejected.","triggerScenarios":"Calling GenerateStreamingReplyAsync on a Mistral agent but receiving non-chunk objects. Typical causes: an intermediary proxy that buffers SSE and returns one full \"chat.completion\" object; the request's stream flag being overridden; or a non-streaming response fed into the streaming processor in tests.","commonSituations":"Corporate proxies or gateways (Azure API Management, nginx buffering) collapsing SSE streams; mocking helpers returning full completion objects into streaming code paths; version drift where the object field name/serialization changes.","solutions":["Verify the raw SSE lines (data: {...}) from the Mistral endpoint and check the \"object\" field of each chunk.","If a proxy buffers the stream, bypass it for Mistral traffic or disable response buffering for text/event-stream.","If streaming is genuinely unavailable, use the non-streaming GenerateReplyAsync path instead.","Align mocks/tests to emit object=\"chat.completion.chunk\" payloads."],"exampleFix":"// before\nif (response.VarObject != \"chat.completion.chunk\")\n{\n    throw new NotSupportedException($\"VarObject {response.VarObject} is not supported\");\n}\n\n// after\nif (response.VarObject == \"chat.completion\")\n{\n    // full completion object where a chunk was expected: fall back to non-streaming processing\n    return ProcessChatCompletionResponse(message, agent);\n}\nif (response.VarObject != \"chat.completion.chunk\")\n{\n    throw new NotSupportedException($\"VarObject {response.VarObject} is not supported\");\n}","handlingStrategy":"validation","validationCode":"// verify streaming actually works before relying on it\nvar probe = await client.StreamingChatCompletionsAsync(testRequest).FirstOrDefaultAsync();\nif (probe?.VarObject != \"chat.completion.chunk\")\n{\n    // endpoint/proxy does not deliver chunks: use non-streaming calls instead\n}","typeGuard":"static bool IsChunk(ChatCompletionResponse r) => r?.VarObject == \"chat.completion.chunk\";","tryCatchPattern":"catch (NotSupportedException ex) when (ex.Message.Contains(\"VarObject\"))\n{\n    // fall back to non-streaming GenerateReplyAsync for this agent\n}","preventionTips":["Disable response buffering on proxies for text/event-stream","Test the streaming path against your real endpoint (not mocks) before shipping"],"tags":["mistral","streaming","sse","proxy","not-supported"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}