Current Behavior: No built-in retry logic. Transient failures (network timeouts, rate limiting) require manual retry implementation.
Problem: AI APIs are inherently unreliable (rate limits, throttling, transient errors). Every production application needs retry logic.
Recommended Changes:
Integrate with Microsoft.Extensions.Http.Resilience patterns
Add RetryPolicy to AgentRunOptions
Support exponential backoff and circuit breaker patterns
Provide sensible defaults for common scenarios
Example Desired API:
// Built-in retry configuration
var agent = chatClient.CreateAIAgent(
name: "ReliableAgent",
instructions: "...",
options: new AgentOptions
{
RetryPolicy = RetryPolicy.Exponential(
maxRetries: 3,
baseDelay: TimeSpan.FromSeconds(1))
});
// Or per-invocation override
var result = await agent.RunAsync(
prompt,
options: new AgentRunOptions
{
RetryPolicy = RetryPolicy.NoRetry // Disable for this call
});
Current Behavior: No built-in retry logic. Transient failures (network timeouts, rate limiting) require manual retry implementation.
Problem: AI APIs are inherently unreliable (rate limits, throttling, transient errors). Every production application needs retry logic.
Recommended Changes:
Integrate with Microsoft.Extensions.Http.Resilience patterns
Add RetryPolicy to AgentRunOptions
Support exponential backoff and circuit breaker patterns
Provide sensible defaults for common scenarios
Example Desired API: