.NET: fix: preserve AG-UI session history - #5904
Merged
Evan Mattson (moonbox3) merged 3 commits intoJun 9, 2026
Merged
Conversation
Roger Barreto (rogerbarreto)
approved these changes
May 20, 2026
Yufeng He (he-yufeng)
temporarily deployed
to
integration
May 20, 2026 22:46 — with
GitHub Actions
Inactive
Yufeng He (he-yufeng)
temporarily deployed
to
integration
May 20, 2026 22:46 — with
GitHub Actions
Inactive
Evan Mattson (moonbox3)
approved these changes
Jun 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 9, 2026
github-actions Bot
added a commit
to microsoft/agent-framework-go
that referenced
this pull request
Jun 9, 2026
The AG-UI provider assigns a thread ID to the session on the first run by calling session.SetServiceID(threadID). The agent's history machinery interpreted any non-empty ServiceID as a signal that the service manages history server-side, and therefore disabled the local HistoryProvider for every subsequent run. This caused conversation history to be dropped after the first turn. Add ServiceDoesNotManageHistory bool to ProviderConfig. Providers that never delegate history to the service (e.g. AGUI) set this flag true; the agent then preserves the HistoryProvider across runs regardless of whether the session has a ServiceID. This also prevents the provider from being flagged as a conflict when a user-configured HistoryProvider is present. Set ServiceDoesNotManageHistory: true in the AGUI provider constructor. Add TestAGUIAgentRun_WithSession_PreservesHistoryAcrossMultipleTurns to verify that the second run sends the full conversation history (3 messages) rather than only the new user message. Ports behavior fix from microsoft/agent-framework#5904. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
George Adams (gdams)
pushed a commit
to microsoft/agent-framework-go
that referenced
this pull request
Jun 9, 2026
#258) The AG-UI provider assigns a thread ID to the session on the first run by calling session.SetServiceID(threadID). The agent's history machinery interpreted any non-empty ServiceID as a signal that the service manages history server-side, and therefore disabled the local HistoryProvider for every subsequent run. This caused conversation history to be dropped after the first turn. Add ServiceDoesNotManageHistory bool to ProviderConfig. Providers that never delegate history to the service (e.g. AGUI) set this flag true; the agent then preserves the HistoryProvider across runs regardless of whether the session has a ServiceID. This also prevents the provider from being flagged as a conflict when a user-configured HistoryProvider is present. Set ServiceDoesNotManageHistory: true in the AGUI provider constructor. Add TestAGUIAgentRun_WithSession_PreservesHistoryAcrossMultipleTurns to verify that the second run sends the full conversation history (3 messages) rather than only the new user message. Ports behavior fix from microsoft/agent-framework#5904. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5898
Verified