-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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