add support filling policy handler ...

This commit is contained in:
2026-11-05 23:19:14 +03:30
parent ae7f5920c1
commit 5307fe4d2f
2 changed files with 57 additions and 7 deletions
+10 -7
View File
@@ -160,7 +160,7 @@ namespace xAiApi.Providers
//
var tasks = servers
.Select(s =>
ConnectAndValidateAsync(s, cancellationToken));
ConnectAndValidateAsync(s, userInfo, cancellationToken));
await Task.WhenAll(tasks);
}
@@ -330,7 +330,7 @@ namespace xAiApi.Providers
await initLock.WaitAsync(cancellationToken);
try
{
await ConnectAndValidateAsync(result, cancellationToken);
await ConnectAndValidateAsync(result, userInfo, cancellationToken);
}
finally
{
@@ -497,7 +497,7 @@ namespace xAiApi.Providers
//
// Update ...
await ConnectAndValidateAsync(result, cancellationToken);
await ConnectAndValidateAsync(result, userInfo, cancellationToken);
}
finally
{
@@ -774,7 +774,7 @@ namespace xAiApi.Providers
await initLock.WaitAsync(cancellationToken);
try
{
await ConnectAndValidateAsync(exists, cancellationToken);
await ConnectAndValidateAsync(exists, userInfo, cancellationToken);
}
finally
{
@@ -862,7 +862,7 @@ namespace xAiApi.Providers
{
if (exists.Enabled)
{
await ConnectAndValidateAsync(exists, cancellationToken);
await ConnectAndValidateAsync(exists, userInfo, cancellationToken);
}
else
{
@@ -1201,7 +1201,8 @@ namespace xAiApi.Providers
private async Task ConnectAndValidateAsync(
XAiMcpServerDto descriptor,
CancellationToken cancellationToken
XUserClaimsInfoDto userInfo = null,
CancellationToken cancellationToken = default
)
{
//
@@ -1215,7 +1216,9 @@ namespace xAiApi.Providers
var client = await CreateClientAsync(descriptor, cts.Token);
await client.PingAsync(cancellationToken: cts.Token);
var serverTools = await client
.ListToolsAsync(cancellationToken: cts.Token);
.ListToolsAsync(
cancellationToken: cts.Token
);
//
clients[descriptor.Id] = client;