You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: TextSearchProvider swallows caller cancellation during pre-invocation search #8795
When TextSearchProvider runs in BeforeAIInvoke mode, ProvideMessagesAsync catches every Exception from the search delegate and returns an empty result.
That also catches OperationCanceledException raised because the caller-provided CancellationToken was cancelled. As a result, the cancellation is treated as a normal search failure and the agent invocation can continue.
Expected behavior
If the caller cancels the token passed to InvokingAsync, the cancellation should propagate.
Ordinary search failures should continue to use the existing best-effort behavior and return no additional context.
Currently this completes without throwing because the cancellation is caught by the generic exception handler.
The fix can remain narrow by only excluding OperationCanceledException from the catch filter when the caller token is actually cancelled, preserving the current handling for unrelated provider-side failures.
Activity