< Summary

Information
Class: NexusLabs.Needlr.Copilot.CopilotChatClientOptions
Assembly: NexusLabs.Needlr.Copilot
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/CopilotChatClientOptions.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 68
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_DefaultModel()100%11100%
get_TokenSource()100%11100%
get_GitHubToken()100%11100%
get_CopilotApiBaseUrl()100%11100%
get_GitHubApiBaseUrl()100%11100%
get_IntegrationId()100%11100%
get_EditorVersion()100%11100%
get_TokenRefreshBufferSeconds()100%11100%
get_MaxRetries()100%11100%
get_RetryBaseDelayMs()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/CopilotChatClientOptions.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.Copilot;
 2
 3/// <summary>
 4/// Configuration options for <see cref="CopilotChatClient"/> and related Copilot API types.
 5/// </summary>
 6public sealed class CopilotChatClientOptions
 7{
 8    /// <summary>
 9    /// The default model to use when <see cref="Microsoft.Extensions.AI.ChatOptions.ModelId"/>
 10    /// is not specified by the caller. Defaults to <c>claude-sonnet-4</c>.
 11    /// </summary>
 3712    public string DefaultModel { get; set; } = "claude-sonnet-4";
 13
 14    /// <summary>
 15    /// Controls where the GitHub OAuth token is sourced from.
 16    /// Defaults to <see cref="CopilotTokenSource.Auto"/>.
 17    /// </summary>
 218    public CopilotTokenSource TokenSource { get; set; } = CopilotTokenSource.Auto;
 19
 20    /// <summary>
 21    /// Optional explicit GitHub OAuth token. When set, takes precedence over
 22    /// <see cref="TokenSource"/> discovery.
 23    /// </summary>
 4824    public string? GitHubToken { get; set; }
 25
 26    /// <summary>
 27    /// The Copilot API base URL. Defaults to <c>https://api.githubcopilot.com</c>.
 28    /// </summary>
 4329    public string CopilotApiBaseUrl { get; set; } = "https://api.githubcopilot.com";
 30
 31    /// <summary>
 32    /// The GitHub API base URL for token exchange.
 33    /// Defaults to <c>https://api.github.com</c>.
 34    /// </summary>
 4035    public string GitHubApiBaseUrl { get; set; } = "https://api.github.com";
 36
 37    /// <summary>
 38    /// Value sent in the <c>Copilot-Integration-Id</c> header.
 39    /// Defaults to <c>needlr-copilot</c>.
 40    /// </summary>
 7141    public string IntegrationId { get; set; } = "copilot-developer-cli";
 42
 43    /// <summary>
 44    /// Value sent in the <c>Editor-Version</c> header.
 45    /// Defaults to <c>NexusLabs.Needlr/1.0.0</c>.
 46    /// </summary>
 3647    public string EditorVersion { get; set; } = "NexusLabs.Needlr/1.0.0";
 48
 49    /// <summary>
 50    /// How many seconds before the Copilot API token expires to trigger a refresh.
 51    /// Defaults to 60.
 52    /// </summary>
 2853    public int TokenRefreshBufferSeconds { get; set; } = 60;
 54
 55    /// <summary>
 56    /// Maximum number of retries on HTTP 429 (Too Many Requests) responses.
 57    /// Defaults to 3. Set to 0 to disable retries.
 58    /// </summary>
 4059    public int MaxRetries { get; set; } = 3;
 60
 61    /// <summary>
 62    /// Initial delay in milliseconds before the first retry on 429.
 63    /// Subsequent retries use exponential backoff (delay × 2^attempt).
 64    /// If the response includes a <c>Retry-After</c> header, that value
 65    /// is used instead. Defaults to 1000ms.
 66    /// </summary>
 3467    public int RetryBaseDelayMs { get; set; } = 1000;
 68}