Repository navigation
Description
Describe the bug
Getting this exception when SK tries to make the file search tool call. This is intermittent.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Azure.AI.Agents.Persistent
StackTrace:
at Azure.AI.Agents.Persistent.RunStepDetailsUpdate.get_FunctionName()
at Microsoft.SemanticKernel.Agents.AzureAI.Internal.AgentThreadActions.<InvokeStreamingAsync>d__6.MoveNext()
at Microsoft.SemanticKernel.Agents.AzureAI.Internal.AgentThreadActions.<InvokeStreamingAsync>d__6.MoveNext()
at Microsoft.SemanticKernel.Agents.AzureAI.Internal.AgentThreadActions.<InvokeStreamingAsync>d__6.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.<RunWithActivityAsync>d__4`1.MoveNext()
at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.<RunWithActivityAsync>d__4`1.MoveNext()
at Microsoft.SemanticKernel.Diagnostics.ActivityExtensions.<RunWithActivityAsync>d__4`1.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgent.<InvokeStreamingAsync>d__23.MoveNext()
at Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgent.<InvokeStreamingAsync>d__23.MoveNext()
at Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgent.<InvokeStreamingAsync>d__23.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
To Reproduce
Steps to reproduce the behavior:
Create a Vector Store
Create a Azure Agent Thread
Assign the Vector Store to the Azure Agent Thread
Add a file to the Vector Store
Try to access the file via user query using the following code.
If it works then try to delete the file from the vector store and ask to make the file search tool call again
await foreach (var streamingContent in azureAgent.InvokeStreamingAsync(streamContent, agentThread, cancellationToken: cts.Token))
where
azureAgent is {Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgent}
streamContent is a string
agentThread is {Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgentThread}
cts is {System.Threading.CancellationTokenSource}
Expected behavior
Supposed to make the file search tool call and bring the results.
Screenshots
Platform
- Language: C#
- Source:
<PackageReference Include="Azure.AI.Agents.Persistent" Version="1.1.0-beta.1" />
<PackageReference Include="Azure.AI.Projects" Version="1.0.0-beta.9" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.54.0" />
<PackageReference Include="Microsoft.SemanticKernel.Core" Version="1.54.0" />
<PackageReference Include="Microsoft.SemanticKernel.Agents.Core" Version="1.54.0" />
<PackageReference Include="Microsoft.SemanticKernel.Agents.AzureAI" Version="1.54.0-preview" />
- AI model: [OpenAI:GPT-4o]
- IDE: [e.g. Visual Studio]
- OS: [e.g. Windows]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBug
Activity
[-]Bug: Null reference exception at Azure.AI.Agents.Persistent.RunStepDetailsUpdate.get_FunctionName()[/-][+].Net: Bug: Null reference exception at Azure.AI.Agents.Persistent.RunStepDetailsUpdate.get_FunctionName()[/+]karthiksimplist commentedon Jun 2, 2025
The actual calls on the thread works fine as I could see the results on the Azure AI Foundry UI threads. It's just the SK throwing this error when it tries to handle the request/repose.
also, getting the following error around the same line - not sure when we would get the error I reported on the bug vs this one.
markharrison commentedon Jun 2, 2025
I have a similar problem - this code works for an AI Foundry Agent when I dont have Bing defined as Knowledge. It gives an Exception when is Bing is set up as Knowledge.
versions:
--
After thought - not sure its similar ... ill open a separate issue . #12351