Skip to content

.NET: [DurableAgents] Tool call content items serialize as empty objects in entity state #4481

Closed

Description

@larohra

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 $type discriminator (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 -> DurableAgentStateContent subtypes
  • 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 through DurableAIAgent entity

Activity

  1. added
    bugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)
    .NETUsage: [Issues, PRs], Target: .Net
    on Mar 4, 2026
  2. changed the title [-][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[/+] on Mar 4, 2026
  3. larohra commented on Mar 4, 2026

    @larohra
    ContributorAuthor

    Durable AI package version where I hit this bug -

    Microsoft.Agents.AI.DurableTask: 1.0.0-preview.260225.1 
    Microsoft.DurableTask.Client.AzureManaged: 1.18.0 
    Microsoft.DurableTask.Worker.AzureManaged: 1.18.0 
    
  4. cgillum commented on Mar 11, 2026

    @cgillum
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .NetbugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)hostingUsage: [Issues, PRs], Target: all hosting related solutions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions