Repository navigation
Description
Message: Object reference not set to an instance of an object.
Stack:
at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionCall(String functionName, String functionArguments)
at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionStep(OpenAIAssistantAgent agent, RunStep step)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items)
at System.Collections.Generic.SparseArrayBuilder1.ReserveOrAdd(IEnumerable1 items)
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.ToArray() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, RunCreationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, RunCreationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult() at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.RunWithActivityAsync[TResult](Func1 getActivity, Func1 operation, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.RunWithActivityAsync[TResult](Func1 getActivity, Func1 operation, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.RunWithActivityAsync[TResult](Func1 getActivity, Func`1 operation, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Microsoft.SemanticKernel.Agents.AgentChat.InvokeStreamingAgentAsync(Agent agent, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentChat.InvokeStreamingAgentAsync(Agent agent, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentChat.InvokeStreamingAgentAsync(Agent agent, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(Agent agent, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(Agent agent, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(Agent agent, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.AgentGroupChat.InvokeStreamingAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsSprint: In Progress
Activity
[-]Null reference error at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionCall[/-][+].NET: Null reference error at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionCall[/+][-].NET: Null reference error at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionCall[/-][+].Net: Null reference error at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.ParseFunctionCall[/+]crickman commentedon May 29, 2025
Not much going on within
ParseFunctionCall...which made it easy to spot the likely candidate:Current:
arguments[argumentKvp.Key] = argumentKvp.Value.ToString();Fixed:
arguments[argumentKvp.Key] = argumentKvp.Value?.ToString();Was able to repro and verify fix with some sample hackery.
Hope to have fix merged by tomorrow.
.Net - Update and Fixes for `AzureAIAgent` (#12348)
.Net - Update and Fixes for `AzureAIAgent` (microsoft#12348)