microsoft / microsoft/agent-framework

.NET: [Bug]: Unable to get chat history from WorkflowSession

Open
#6,946 1 comment 1 reaction 1 assignee View on GitHub

@peibekwe is already working on this.

Since Jul 7, 2026.

.NET workflows
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

### Description

When using a workflow as agent there is currently no way to access the chat history of the WorkflowSession in a comfortable way.

I have tried the following three things:

- As WorkflowSession is internal we can't access the public ChatHistoryProvider property (which is of type WorkflowChatHistoryProvider).

- We also can't supply an own implementation of ChatHistoryProvider for a WorkflowSession because in the ctor the following code is called:
`this.ChatHistoryProvider = new WorkflowChatHistoryProvider();`

- The StateBag stores the WorkflowChatHistoryProvider in a serialized way. But I can't extract it back from the StateBag because WorkflowChatHistoryProvider is also internal.

### Package Versions

Microsoft.Agents.AI.Workflows:1.13.0

### .NET Version

.NET 10

### Additional Context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.