Skip to content

AG-UI MapAGUI() doesn't use session store or map message AuthorName #4920

@graemefoster

Description

@graemefoster

Summary

MapAGUI() in Microsoft.Agents.AI.Hosting.AGUI.AspNetCore hardcodes session: null when calling aiAgent.RunStreamingAsync(), even though:

  1. A session store is configured via .WithSessionStore()
  2. The ag_ui_thread_id is available in AdditionalProperties
  3. AIHostAgent has GetOrCreateSessionAsync(conversationId) ready to use

var messages = input.Messages.AsChatMessages(jsonSerializerOptions);

This means every AG-UI request starts a fresh workflow run with no memory of the previous conversation state. The client must round-trip the entire message history each request. Which means a client can inject anything into the conversation.

Should AG-UI allow you to pass only the 'next' message, and re-use the existing session on the backend?

Environment

  • Microsoft.Agents.AI.Hosting.AGUI.AspNetCore 1.0.0-preview.260311.1
  • Microsoft.Agents.AI.Workflows 1.0.0-rc4
  • Microsoft.Agents.AI 1.0.0-rc4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions