< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.AgentResilienceAttribute
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/AgentResilienceAttribute.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 30
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_MaxRetries()100%11100%
get_TimeoutSeconds()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/AgentResilienceAttribute.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework;
 2
 3/// <summary>
 4/// Configures per-agent resilience settings that override the global default
 5/// set by <c>UsingResilience()</c> on <see cref="AgentFrameworkSyringe"/>.
 6/// </summary>
 7/// <remarks>
 8/// Apply this attribute alongside <see cref="NeedlrAiAgentAttribute"/> to configure
 9/// agent-specific retry and timeout behaviour.
 10/// </remarks>
 11[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
 12public sealed class AgentResilienceAttribute : Attribute
 13{
 14    /// <summary>Gets the maximum number of retry attempts (0 = no retry).</summary>
 615    public int MaxRetries { get; }
 16
 17    /// <summary>Gets the per-attempt timeout in seconds (0 = no timeout).</summary>
 518    public int TimeoutSeconds { get; }
 19
 20    /// <summary>
 21    /// Initialises a new <see cref="AgentResilienceAttribute"/>.
 22    /// </summary>
 23    /// <param name="maxRetries">Maximum number of retry attempts. Defaults to 2.</param>
 24    /// <param name="timeoutSeconds">Per-attempt timeout in seconds. 0 means no timeout.</param>
 64525    public AgentResilienceAttribute(int maxRetries = 2, int timeoutSeconds = 0)
 26    {
 64527        MaxRetries = maxRetries;
 64528        TimeoutSeconds = timeoutSeconds;
 64529    }
 30}