Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

.NET: ChatHistoryMemoryProvider swallows caller cancellation

Closed Beginner friendly
#8,811 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
ai, backend

Research direction

Start at ChatHistoryMemoryProvider's BeforeAIInvoke search path and post-invocation UpsertAsync storage path, focusing on their generic exception handlers. Reproduce both cases with an already-cancelled caller token and verify caller cancellation propagates while provider-side failures still complete best-effort.

Written by the indexing model from the issue text.

Description

.NET triage
Description

ChatHistoryMemoryProvider treats vector search and history storage failures as best-effort, but its generic exception handlers also swallow OperationCanceledException when the caller-provided CancellationToken has been cancelled.

This affects both the BeforeAIInvoke search path and the post-invocation UpsertAsync storage path, allowing work to continue after caller cancellation.

Expected behavior

Caller-triggered cancellation should propagate. Unrelated provider-side failures, including provider-side cancellation when the caller token remains active, should keep the existing best-effort behavior.

Reproduction

With an already-cancelled caller token, configure SearchAsync or UpsertAsync to surface cancellation. Both paths currently complete without propagating OperationCanceledException.

The fix can remain narrow by filtering the generic catch based on whether the caller token is actually cancelled.

Dominant language
Python
Stars
13.9k
Forks
2.4k
Avg merge
1d 16h
Merged PRs (30d)
432

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from microsoft/agent-framework

All issues in microsoft/agent-framework

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.