Handle settings logs agent failures
PR and Push Build/Test / build-and-test (push) Successful in 9m8s

This commit is contained in:
2026-06-09 17:10:06 +02:00
parent 8af89a622d
commit ecdd23bde7
8 changed files with 147 additions and 15 deletions
@@ -126,12 +126,14 @@ public sealed class LiteLlmResponsesChatClientTests
}
""")
});
using var client = CreateClient(handler, reconnectionAttempts: 1);
var retryCount = 0;
using var client = CreateClient(handler, reconnectionAttempts: 1, retrying: () => retryCount++);
var response = await client.GetResponseAsync([new ChatMessage(ChatRole.User, "write summary")]);
Assert.Equal("Done.", response.Text);
Assert.Equal(2, handler.RequestCount);
Assert.Equal(1, retryCount);
}
[Fact]
@@ -303,7 +305,8 @@ public sealed class LiteLlmResponsesChatClientTests
private static LiteLlmResponsesChatClient CreateClient(
HttpMessageHandler handler,
int reconnectionAttempts,
LiteLlmResponsesCompactionOptions? compactionOptions = null)
LiteLlmResponsesCompactionOptions? compactionOptions = null,
Action? retrying = null)
{
return new LiteLlmResponsesChatClient(
new HttpClient(handler)
@@ -316,7 +319,8 @@ public sealed class LiteLlmResponsesChatClientTests
reasoningEffort: "none",
reconnectionAttempts,
TimeSpan.Zero,
compactionOptions);
compactionOptions,
retrying: retrying);
}
private sealed class SequencedHttpMessageHandler : HttpMessageHandler