Repository navigation
Description
Description
When inspecting Durable AI Agent entity state (via the DTS emulator dashboard or programmatically), tool call content items in the contents array of assistant messages are serialized as empty JSON objects {}. This makes it difficult to understand what the agent actually did during execution.
Example from DTS dashboard entity state:
{
"messages": [
{
"role": "assistant",
"contents": [
{},
{},
{},
{"$type": "text", "text": ""},
{},
{},
{},
{"$type": "text", "text": "I need to create a project file..."},
{},
{}
]
}
]
}The {"$type": "text", "text": "..."} entries are readable, but the {} entries — which represent tool calls (file reads, shell commands, code edits) — contain no useful information. There is no $type discriminator, function name, call ID, or any metadata.
Expected Behavior
Tool call content items should serialize with at minimum:
- A
$typediscriminator (e.g.,"functionCall","functionResult") - The function/tool name
- Optionally: a call ID for correlation
For example:
{"$type": "functionCall", "name": "read_file", "callId": "abc123"}The full payload (args, file contents) can remain excluded to keep entity state small — but the structural metadata should be present for debuggability.
Context
- Serialization path:
DurableAgentJsonUtilities->DurableAgentStateMessage->DurableAgentStateContentsubtypes - Content types affected:
DurableAgentStateFunctionCallContent,DurableAgentStateFunctionResultContent(and any other non-text content types) - Impact: Developers debugging agent behavior via the DTS dashboard see many empty
{}objects with no way to correlate them to actual tool invocations - Workaround: None — the information is lost at serialization time
Environment
- MAF version: Latest (NuGet
Microsoft.Agents.AI.DurableTask) - DTS: Emulator (
mcr.microsoft.com/dts/dts-emulator:latest) - .NET: 10.0
- Agent type: Copilot agent via
CopilotClient.AsAIAgent()invoked throughDurableAIAgententity
Activity
[-][DurableAgents] Tool call content items serialize as empty objects in entity state[/-][+].NET: [DurableAgents] Tool call content items serialize as empty objects in entity state[/+]larohra commentedon Mar 4, 2026
Durable AI package version where I hit this bug -
cgillum commentedon Mar 11, 2026
Laveesh Rohra (@larohra) can you provide a bit more detail on how to reproduce this? Any code snippets you can share?
EDIT: I got the context I needed offline. This is primarily an issue when wrapping the GitHubCopilotAgent and it's something I'm able to see as well. These events don't need to be captured at all and can be safely discarded.
Filter empty AIContent from durable agent state responses
.NET: [Durable Agents] Filter empty AIContent from durable agent stat…
.NET: [Durable Agents] Filter empty AIContent from durable agent stat…