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
[MTP Diagnostic Analysis] IChatClientProvider.IsAvailable is never honored by provider registration or retrieval #8410
IChatClientProvider exposes IsAvailable specifically for providers that are registered but not currently usable, but the platform never checks that property. GetChatClientAsync() always calls CreateChatClientAsync(), so an unavailable provider still fails with an exception instead of behaving as unavailable.
missing variables cause throw new InvalidOperationException(...)
Why this is a real issue
The API contract says providers can be present but unavailable. In practice, registering such a provider changes GetChatClientAsync() from returning null (no provider) to throwing InvalidOperationException (provider present but unusable). Consumers cannot safely treat IsAvailable as the intended availability gate because the platform ignores it.
Suggested resolution
Respect IsAvailable either during provider registration or inside GetChatClientAsync(). Returning null (or a dedicated unavailable result) would make the abstraction behave as documented, while still allowing callers to inspect provider metadata separately if needed.
Activity