Skip to content

.NET - AG-UI Support more AG-UI event types. #2558

Closed
3 of 4 issues completed
Closed

Description

We currently support emitting the following AG-UI events:

RUN_STARTED
RUN_FINISHED
RUN_ERROR
TEXT_MESSAGE_START
TEXT_MESSAGE_CONTENT
TEXT_MESSAGE_END
TOOL_CALL_START
TOOL_CALL_ARGS
TOOL_CALL_END
TOOL_CALL_RESULT
STATE_SNAPSHOT
STATE_DELTA

This is because we are able to map these events to specific events and AIContent instances:

  • RUN_STARTED: We unconditionally emit this event at the beginning of a run.

  • RUN_FINISHED: We unconditionally emit this event at the end of a run.

  • RUN_ERROR: We emit this event when an error happens.

  • TEXT_MESSAGE_START: We emit this event when we see an update with a TextContent instance for the first time in a message.

  • TEXT_MESSAGE_CONTENT: We emit this event every time we see a TextContent instance for a message.

  • TEXT_MESSAGE_END: We emit this whenever we start see an AIContent instance for another message.

  • TOOL_CALL_START: We emit this whenever we see a ToolCallContent in the update.

  • TOOL_CALL_ARGS: We emit this for the ToolCallContent arguments.

  • TOOL_CALL_END: We emit this right after the ToolCallContent.

  • TOOL_CALL_RESULT: We emit this when we see the ToolCallResultContent on a message.

  • STATE_SNAPSHOT: We map this as a DataContent with type application/json.

    • This is a convention that we defined to map from Microsoft.Extensions.AI to AG-UI.
  • STATE_DELTA: We map this as a DataContent with type application/json-patch+json.

    • This is a convention that we defined to map from Microsoft.Extensions.AI to AG-UI.

There are however other events we don't support because we don't have a reasonable way to map them.

  • STEP_STARTED: Signals the start of a step within an agent run.
  • STEP_FINISHED: Signals the completion of a step within an agent run.
  • MESSAGES_SNAPSHOT: Provides a snapshot of all messages in a conversation.
  • This is useful to sync the UI with existing conversations.
  • ACTIVITY_SNAPSHOT: Delivers a complete snapshot of an activity message.
  • This represents a step that is happening as part of a run, like "PLAN" or "SEARCH" and includes
    custom information related to that activity.
  • ACTIVITY_DELTA: Provides incremental updates to an activity snapshot using JSON Patch.
  • RAW: Used to pass through events from external systems.
  • CUSTOM: Used to pass application specific events.

We don't have good ways of representing this information using Microsoft.Extensions.AI concepts. There are three ways that we can go about this.

At some point we need to make a decision as there are asks that are depending on this.

#2270
#2494
#2510

Activity

  1. stephentoub commented on Dec 2, 2025

    @stephentoub
    Member

    If we need to do something here, my preference is option 1 ("Create/make public the AG-UI event types that we use internally."), ideally with the types as part of a dedicated AG-UI library, which the agent layer wraps (as it does today).

  2. MaciejSzczepanskiRedslim commented on Dec 23, 2025

    @MaciejSzczepanskiRedslim

    The frustrating part is that we wanted to consume an AG-UI endpoint exposed by the Python Agent Framework from the .NET SDK (python endpoint produced: MESSAGES_SNAPSHOT). This discrepancy between the two implementations shouldn’t exist. One of the key advantages of the framework is the ability to switch between different technology stacks while keeping a consistent API and familiar concepts.

  3. yinyihao1 commented on Mar 20, 2026

    @yinyihao1

    I saw support for the AG UI protocol on the official website. However, it wasn't until I spent a week discussing the technical details with the front-end engineers that I discovered so many event types are currently unsupported.

    I hope support will be added soon.

  4. paulguz-datapa commented on Mar 20, 2026

    @paulguz-datapa

    The failure to fully support AG-UI (and what is a protocol if it is not implemented fully?) drives me away from using .Net for agentic front-ends.

  5. jeffinsibycoremont commented on Apr 1, 2026

    @jeffinsibycoremont

    I have an open .NET PR open for adding support for reasoning events #4953. Appreciate any feedback :)

  6. halllo commented on Apr 11, 2026

    @halllo

    I have a .NET PR open for adding support for ACTIVITY_SNAPSHOT and proxying resources/read and tools/call requests, which are needed for MCP Apps #5216

  7. MD-V commented on Jun 19, 2026

    @MD-V

    Javier Calvarro Nelson (@javiercn) are there improvements for the .NET AG-UI implementation planned (e.g. support for custom, activity and step events) or are you dependent on community PRs?

  8. javiercn commented on Aug 18, 2026

    @javiercn
    ContributorAuthor

    The current AG-UI SDK integration provides the extensibility requested here.

    The complete public event hierarchy now lives in AGUI.Abstractions, including step, activity, message-snapshot, raw, custom, state, and reasoning events.

    An agent can emit a specific protocol event through RawRepresentation:

    yield return new AgentResponseUpdate(new ChatResponseUpdate
    {
        Role = ChatRole.Assistant,
        RawRepresentation = new ActivitySnapshotEvent
        {
            MessageId = "activity-1",
            ActivityType = "PLAN",
            Content = JsonSerializer.SerializeToElement(
                new { status = "planning" }),
        },
    });

    AGUI.Server forwards public BaseEvent instances directly. Applications can also register mappings with AGUIStreamOptions.MapContent, MapCall, MapResult, and MapInterrupt.

    Events with canonical MEAI equivalents continue to map automatically. Application-specific semantics remain explicit rather than the framework guessing whether arbitrary content represents a step, activity, custom event, or snapshot.

    Since all AG-UI event types can now be constructed and emitted through public APIs, this issue can be closed as resolved.

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

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .Netag-uiUsage: [Issues, PRs], Target: AG-UI protocol integration

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions