diff --git a/dotnet/README.md b/dotnet/README.md index bda10059d..fe226f77f 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -77,8 +77,8 @@ new CopilotClient(CopilotClientOptions? options = null) - `Cwd` - Working directory for the CLI process - `Environment` - Environment variables to pass to the CLI process - `Logger` - `ILogger` instance for SDK logging -- `GithubToken` - GitHub token for authentication. When provided, takes priority over other auth methods. -- `UseLoggedInUser` - Whether to use logged-in user for authentication (default: true, but false when `GithubToken` is provided). Cannot be used with `CliUrl`. +- `GitHubToken` - GitHub token for authentication. When provided, takes priority over other auth methods. +- `UseLoggedInUser` - Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `CliUrl`. #### Methods diff --git a/dotnet/src/Client.cs b/dotnet/src/Client.cs index 8c70a4a2b..cf29dd116 100644 --- a/dotnet/src/Client.cs +++ b/dotnet/src/Client.cs @@ -117,9 +117,9 @@ public CopilotClient(CopilotClientOptions? options = null) } // Validate auth options with external server - if (!string.IsNullOrEmpty(_options.CliUrl) && (!string.IsNullOrEmpty(_options.GithubToken) || _options.UseLoggedInUser != null)) + if (!string.IsNullOrEmpty(_options.CliUrl) && (!string.IsNullOrEmpty(_options.GitHubToken) || _options.UseLoggedInUser != null)) { - throw new ArgumentException("GithubToken and UseLoggedInUser cannot be used with CliUrl (external server manages its own auth)"); + throw new ArgumentException("GitHubToken and UseLoggedInUser cannot be used with CliUrl (external server manages its own auth)"); } _logger = _options.Logger ?? NullLogger.Instance; @@ -944,13 +944,13 @@ private async Task VerifyProtocolVersionAsync(Connection connection, Cancellatio } // Add auth-related flags - if (!string.IsNullOrEmpty(options.GithubToken)) + if (!string.IsNullOrEmpty(options.GitHubToken)) { args.AddRange(["--auth-token-env", "COPILOT_SDK_AUTH_TOKEN"]); } - // Default UseLoggedInUser to false when GithubToken is provided - var useLoggedInUser = options.UseLoggedInUser ?? string.IsNullOrEmpty(options.GithubToken); + // Default UseLoggedInUser to false when GitHubToken is provided + var useLoggedInUser = options.UseLoggedInUser ?? string.IsNullOrEmpty(options.GitHubToken); if (!useLoggedInUser) { args.Add("--no-auto-login"); @@ -982,9 +982,9 @@ private async Task VerifyProtocolVersionAsync(Connection connection, Cancellatio startInfo.Environment.Remove("NODE_DEBUG"); // Set auth token in environment if provided - if (!string.IsNullOrEmpty(options.GithubToken)) + if (!string.IsNullOrEmpty(options.GitHubToken)) { - startInfo.Environment["COPILOT_SDK_AUTH_TOKEN"] = options.GithubToken; + startInfo.Environment["COPILOT_SDK_AUTH_TOKEN"] = options.GitHubToken; } var cliProcess = new Process { StartInfo = startInfo }; diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index acf03b4d2..1b716cd41 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -44,7 +44,7 @@ protected CopilotClientOptions(CopilotClientOptions? other) CliUrl = other.CliUrl; Cwd = other.Cwd; Environment = other.Environment; - GithubToken = other.GithubToken; + GitHubToken = other.GitHubToken; Logger = other.Logger; LogLevel = other.LogLevel; Port = other.Port; @@ -72,13 +72,23 @@ protected CopilotClientOptions(CopilotClientOptions? other) /// When provided, the token is passed to the CLI server via environment variable. /// This takes priority over other authentication methods. /// - public string? GithubToken { get; set; } + public string? GitHubToken { get; set; } + + /// + /// Obsolete. Use instead. + /// + [Obsolete("Use GitHubToken instead.", error: false)] + public string? GithubToken + { + get => GitHubToken; + set => GitHubToken = value; + } /// /// Whether to use the logged-in user for authentication. /// When true, the CLI server will attempt to use stored OAuth tokens or gh CLI auth. - /// When false, only explicit tokens (GithubToken or environment variables) are used. - /// Default: true (but defaults to false when GithubToken is provided). + /// When false, only explicit tokens (GitHubToken or environment variables) are used. + /// Default: true (but defaults to false when GitHubToken is provided). /// public bool? UseLoggedInUser { get; set; } diff --git a/dotnet/test/ClientTests.cs b/dotnet/test/ClientTests.cs index ee5b73bc7..bbb3e8544 100644 --- a/dotnet/test/ClientTests.cs +++ b/dotnet/test/ClientTests.cs @@ -149,14 +149,14 @@ public async Task Should_List_Models_When_Authenticated() } [Fact] - public void Should_Accept_GithubToken_Option() + public void Should_Accept_GitHubToken_Option() { var options = new CopilotClientOptions { - GithubToken = "gho_test_token" + GitHubToken = "gho_test_token" }; - Assert.Equal("gho_test_token", options.GithubToken); + Assert.Equal("gho_test_token", options.GitHubToken); } [Fact] @@ -179,11 +179,11 @@ public void Should_Allow_Explicit_UseLoggedInUser_False() } [Fact] - public void Should_Allow_Explicit_UseLoggedInUser_True_With_GithubToken() + public void Should_Allow_Explicit_UseLoggedInUser_True_With_GitHubToken() { var options = new CopilotClientOptions { - GithubToken = "gho_test_token", + GitHubToken = "gho_test_token", UseLoggedInUser = true }; @@ -191,14 +191,14 @@ public void Should_Allow_Explicit_UseLoggedInUser_True_With_GithubToken() } [Fact] - public void Should_Throw_When_GithubToken_Used_With_CliUrl() + public void Should_Throw_When_GitHubToken_Used_With_CliUrl() { Assert.Throws(() => { _ = new CopilotClient(new CopilotClientOptions { CliUrl = "localhost:8080", - GithubToken = "gho_test_token" + GitHubToken = "gho_test_token" }); }); } diff --git a/dotnet/test/CloneTests.cs b/dotnet/test/CloneTests.cs index 45eaaae16..8982c5d64 100644 --- a/dotnet/test/CloneTests.cs +++ b/dotnet/test/CloneTests.cs @@ -24,7 +24,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties() AutoStart = false, AutoRestart = false, Environment = new Dictionary { ["KEY"] = "value" }, - GithubToken = "ghp_test", + GitHubToken = "ghp_test", UseLoggedInUser = false, }; @@ -40,7 +40,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties() Assert.Equal(original.AutoStart, clone.AutoStart); Assert.Equal(original.AutoRestart, clone.AutoRestart); Assert.Equal(original.Environment, clone.Environment); - Assert.Equal(original.GithubToken, clone.GithubToken); + Assert.Equal(original.GitHubToken, clone.GitHubToken); Assert.Equal(original.UseLoggedInUser, clone.UseLoggedInUser); } diff --git a/dotnet/test/Harness/E2ETestContext.cs b/dotnet/test/Harness/E2ETestContext.cs index b8f3bdeb1..00fc32075 100644 --- a/dotnet/test/Harness/E2ETestContext.cs +++ b/dotnet/test/Harness/E2ETestContext.cs @@ -94,7 +94,7 @@ public IReadOnlyDictionary GetEnvironment() Cwd = WorkDir, CliPath = GetCliPath(_repoRoot), Environment = GetEnvironment(), - GithubToken = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")) ? "fake-token-for-e2e-tests" : null, + GitHubToken = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")) ? "fake-token-for-e2e-tests" : null, }); public async ValueTask DisposeAsync() diff --git a/go/README.md b/go/README.md index 37cb7ce07..c528e945c 100644 --- a/go/README.md +++ b/go/README.md @@ -138,8 +138,8 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec - `AutoStart` (\*bool): Auto-start server on first use (default: true). Use `Bool(false)` to disable. - `AutoRestart` (\*bool): Auto-restart on crash (default: true). Use `Bool(false)` to disable. - `Env` ([]string): Environment variables for CLI process (default: inherits from current process) -- `GithubToken` (string): GitHub token for authentication. When provided, takes priority over other auth methods. -- `UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GithubToken` is provided). Cannot be used with `CLIUrl`. +- `GitHubToken` (string): GitHub token for authentication. When provided, takes priority over other auth methods. +- `UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `CLIUrl`. **SessionConfig:** diff --git a/go/client.go b/go/client.go index 68f58d859..82c095274 100644 --- a/go/client.go +++ b/go/client.go @@ -134,8 +134,8 @@ func NewClient(options *ClientOptions) *Client { } // Validate auth options with external server - if options.CLIUrl != "" && (options.GithubToken != "" || options.UseLoggedInUser != nil) { - panic("GithubToken and UseLoggedInUser cannot be used with CLIUrl (external server manages its own auth)") + if options.CLIUrl != "" && (options.GitHubToken != "" || options.UseLoggedInUser != nil) { + panic("GitHubToken and UseLoggedInUser cannot be used with CLIUrl (external server manages its own auth)") } // Parse CLIUrl if provided @@ -177,8 +177,8 @@ func NewClient(options *ClientOptions) *Client { if options.AutoRestart != nil { client.autoRestart = *options.AutoRestart } - if options.GithubToken != "" { - opts.GithubToken = options.GithubToken + if options.GitHubToken != "" { + opts.GitHubToken = options.GitHubToken } if options.UseLoggedInUser != nil { opts.UseLoggedInUser = options.UseLoggedInUser @@ -1040,14 +1040,14 @@ func (c *Client) startCLIServer(ctx context.Context) error { } // Add auth-related flags - if c.options.GithubToken != "" { + if c.options.GitHubToken != "" { args = append(args, "--auth-token-env", "COPILOT_SDK_AUTH_TOKEN") } - // Default useLoggedInUser to false when GithubToken is provided + // Default useLoggedInUser to false when GitHubToken is provided useLoggedInUser := true if c.options.UseLoggedInUser != nil { useLoggedInUser = *c.options.UseLoggedInUser - } else if c.options.GithubToken != "" { + } else if c.options.GitHubToken != "" { useLoggedInUser = false } if !useLoggedInUser { @@ -1074,8 +1074,8 @@ func (c *Client) startCLIServer(ctx context.Context) error { // Add auth token if needed. c.process.Env = c.options.Env - if c.options.GithubToken != "" { - c.process.Env = append(c.process.Env, "COPILOT_SDK_AUTH_TOKEN="+c.options.GithubToken) + if c.options.GitHubToken != "" { + c.process.Env = append(c.process.Env, "COPILOT_SDK_AUTH_TOKEN="+c.options.GitHubToken) } if c.useStdio { diff --git a/go/client_test.go b/go/client_test.go index b2e9cdce6..d21cc0185 100644 --- a/go/client_test.go +++ b/go/client_test.go @@ -255,17 +255,17 @@ func TestClient_URLParsing(t *testing.T) { } func TestClient_AuthOptions(t *testing.T) { - t.Run("should accept GithubToken option", func(t *testing.T) { + t.Run("should accept GitHubToken option", func(t *testing.T) { client := NewClient(&ClientOptions{ - GithubToken: "gho_test_token", + GitHubToken: "gho_test_token", }) - if client.options.GithubToken != "gho_test_token" { - t.Errorf("Expected GithubToken to be 'gho_test_token', got %q", client.options.GithubToken) + if client.options.GitHubToken != "gho_test_token" { + t.Errorf("Expected GitHubToken to be 'gho_test_token', got %q", client.options.GitHubToken) } }) - t.Run("should default UseLoggedInUser to nil when no GithubToken", func(t *testing.T) { + t.Run("should default UseLoggedInUser to nil when no GitHubToken", func(t *testing.T) { client := NewClient(&ClientOptions{}) if client.options.UseLoggedInUser != nil { @@ -283,9 +283,9 @@ func TestClient_AuthOptions(t *testing.T) { } }) - t.Run("should allow explicit UseLoggedInUser true with GithubToken", func(t *testing.T) { + t.Run("should allow explicit UseLoggedInUser true with GitHubToken", func(t *testing.T) { client := NewClient(&ClientOptions{ - GithubToken: "gho_test_token", + GitHubToken: "gho_test_token", UseLoggedInUser: Bool(true), }) @@ -294,12 +294,12 @@ func TestClient_AuthOptions(t *testing.T) { } }) - t.Run("should throw error when GithubToken is used with CLIUrl", func(t *testing.T) { + t.Run("should throw error when GitHubToken is used with CLIUrl", func(t *testing.T) { defer func() { if r := recover(); r == nil { t.Error("Expected panic for auth options with CLIUrl") } else { - matched, _ := regexp.MatchString("GithubToken and UseLoggedInUser cannot be used with CLIUrl", r.(string)) + matched, _ := regexp.MatchString("GitHubToken and UseLoggedInUser cannot be used with CLIUrl", r.(string)) if !matched { t.Errorf("Expected panic message about auth options, got: %v", r) } @@ -308,7 +308,7 @@ func TestClient_AuthOptions(t *testing.T) { NewClient(&ClientOptions{ CLIUrl: "localhost:8080", - GithubToken: "gho_test_token", + GitHubToken: "gho_test_token", }) }) @@ -317,7 +317,7 @@ func TestClient_AuthOptions(t *testing.T) { if r := recover(); r == nil { t.Error("Expected panic for auth options with CLIUrl") } else { - matched, _ := regexp.MatchString("GithubToken and UseLoggedInUser cannot be used with CLIUrl", r.(string)) + matched, _ := regexp.MatchString("GitHubToken and UseLoggedInUser cannot be used with CLIUrl", r.(string)) if !matched { t.Errorf("Expected panic message about auth options, got: %v", r) } diff --git a/go/internal/e2e/testharness/context.go b/go/internal/e2e/testharness/context.go index 570594edc..cefb87b58 100644 --- a/go/internal/e2e/testharness/context.go +++ b/go/internal/e2e/testharness/context.go @@ -167,7 +167,7 @@ func (c *TestContext) NewClient() *copilot.Client { // Use fake token in CI to allow cached responses without real auth if os.Getenv("CI") == "true" { - options.GithubToken = "fake-token-for-e2e-tests" + options.GitHubToken = "fake-token-for-e2e-tests" } return copilot.NewClient(options) diff --git a/go/types.go b/go/types.go index 6abbf4a12..f3f299ed5 100644 --- a/go/types.go +++ b/go/types.go @@ -44,14 +44,14 @@ type ClientOptions struct { // If Env contains duplicate environment keys, only the last value in the // slice for each duplicate key is used. Env []string - // GithubToken is the GitHub token to use for authentication. + // GitHubToken is the GitHub token to use for authentication. // When provided, the token is passed to the CLI server via environment variable. // This takes priority over other authentication methods. - GithubToken string + GitHubToken string // UseLoggedInUser controls whether to use the logged-in user for authentication. // When true, the CLI server will attempt to use stored OAuth tokens or gh CLI auth. - // When false, only explicit tokens (GithubToken or environment variables) are used. - // Default: true (but defaults to false when GithubToken is provided). + // When false, only explicit tokens (GitHubToken or environment variables) are used. + // Default: true (but defaults to false when GitHubToken is provided). // Use Bool(false) to explicitly disable. UseLoggedInUser *bool } diff --git a/python/copilot/session.py b/python/copilot/session.py index 7332f6c5f..af02a312d 100644 --- a/python/copilot/session.py +++ b/python/copilot/session.py @@ -14,6 +14,8 @@ from .generated.session_events import SessionEvent, SessionEventType, session_event_from_dict from .types import ( MessageOptions, + PermissionRequest, + PermissionRequestResult, SessionHooks, Tool, ToolHandler, @@ -308,7 +310,9 @@ def _register_permission_handler(self, handler: Optional[_PermissionHandlerFn]) with self._permission_handler_lock: self._permission_handler = handler - async def _handle_permission_request(self, request: dict) -> dict: + async def _handle_permission_request( + self, request: PermissionRequest + ) -> PermissionRequestResult: """ Handle a permission request from the Copilot CLI. diff --git a/test/scenarios/auth/gh-app/csharp/Program.cs b/test/scenarios/auth/gh-app/csharp/Program.cs index 70f5f379c..1f2e27ccf 100644 --- a/test/scenarios/auth/gh-app/csharp/Program.cs +++ b/test/scenarios/auth/gh-app/csharp/Program.cs @@ -61,7 +61,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = accessToken, + GitHubToken = accessToken, }); await client.StartAsync(); diff --git a/test/scenarios/auth/gh-app/go/main.go b/test/scenarios/auth/gh-app/go/main.go index d26594779..4aaad3b4b 100644 --- a/test/scenarios/auth/gh-app/go/main.go +++ b/test/scenarios/auth/gh-app/go/main.go @@ -162,7 +162,7 @@ func main() { } client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: token, + GitHubToken: token, }) ctx := context.Background() diff --git a/test/scenarios/bundling/fully-bundled/csharp/Program.cs b/test/scenarios/bundling/fully-bundled/csharp/Program.cs index 50505b776..cb67c903c 100644 --- a/test/scenarios/bundling/fully-bundled/csharp/Program.cs +++ b/test/scenarios/bundling/fully-bundled/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/bundling/fully-bundled/go/main.go b/test/scenarios/bundling/fully-bundled/go/main.go index 5543f6b4d..e548a08e7 100644 --- a/test/scenarios/bundling/fully-bundled/go/main.go +++ b/test/scenarios/bundling/fully-bundled/go/main.go @@ -12,7 +12,7 @@ import ( func main() { // Go SDK auto-reads COPILOT_CLI_PATH from env client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/callbacks/hooks/csharp/Program.cs b/test/scenarios/callbacks/hooks/csharp/Program.cs index 14579e3d0..30b34e309 100644 --- a/test/scenarios/callbacks/hooks/csharp/Program.cs +++ b/test/scenarios/callbacks/hooks/csharp/Program.cs @@ -5,7 +5,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/callbacks/hooks/go/main.go b/test/scenarios/callbacks/hooks/go/main.go index 7b1b1a59b..c084c3a79 100644 --- a/test/scenarios/callbacks/hooks/go/main.go +++ b/test/scenarios/callbacks/hooks/go/main.go @@ -23,7 +23,7 @@ func main() { } client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/callbacks/permissions/csharp/Program.cs b/test/scenarios/callbacks/permissions/csharp/Program.cs index be00015a9..7803c3a75 100644 --- a/test/scenarios/callbacks/permissions/csharp/Program.cs +++ b/test/scenarios/callbacks/permissions/csharp/Program.cs @@ -5,7 +5,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/callbacks/permissions/go/main.go b/test/scenarios/callbacks/permissions/go/main.go index 7dad320c3..1ac49c04d 100644 --- a/test/scenarios/callbacks/permissions/go/main.go +++ b/test/scenarios/callbacks/permissions/go/main.go @@ -17,7 +17,7 @@ func main() { ) client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/callbacks/user-input/csharp/Program.cs b/test/scenarios/callbacks/user-input/csharp/Program.cs index 0ffed2469..4e1c15cab 100644 --- a/test/scenarios/callbacks/user-input/csharp/Program.cs +++ b/test/scenarios/callbacks/user-input/csharp/Program.cs @@ -5,7 +5,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/callbacks/user-input/go/main.go b/test/scenarios/callbacks/user-input/go/main.go index 9405de035..91d0c86ec 100644 --- a/test/scenarios/callbacks/user-input/go/main.go +++ b/test/scenarios/callbacks/user-input/go/main.go @@ -17,7 +17,7 @@ var ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/modes/default/csharp/Program.cs b/test/scenarios/modes/default/csharp/Program.cs index 974a93036..243fcb922 100644 --- a/test/scenarios/modes/default/csharp/Program.cs +++ b/test/scenarios/modes/default/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/modes/default/go/main.go b/test/scenarios/modes/default/go/main.go index b17ac1e88..dfae25178 100644 --- a/test/scenarios/modes/default/go/main.go +++ b/test/scenarios/modes/default/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/modes/minimal/csharp/Program.cs b/test/scenarios/modes/minimal/csharp/Program.cs index 626e13970..94cbc2034 100644 --- a/test/scenarios/modes/minimal/csharp/Program.cs +++ b/test/scenarios/modes/minimal/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/modes/minimal/go/main.go b/test/scenarios/modes/minimal/go/main.go index 1e6d46a53..c39c24f65 100644 --- a/test/scenarios/modes/minimal/go/main.go +++ b/test/scenarios/modes/minimal/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/prompts/attachments/csharp/Program.cs b/test/scenarios/prompts/attachments/csharp/Program.cs index 9e28c342d..357444a6f 100644 --- a/test/scenarios/prompts/attachments/csharp/Program.cs +++ b/test/scenarios/prompts/attachments/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/prompts/attachments/go/main.go b/test/scenarios/prompts/attachments/go/main.go index bb1486da2..4b248bf95 100644 --- a/test/scenarios/prompts/attachments/go/main.go +++ b/test/scenarios/prompts/attachments/go/main.go @@ -14,7 +14,7 @@ const systemPrompt = `You are a helpful assistant. Answer questions about attach func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/prompts/reasoning-effort/csharp/Program.cs b/test/scenarios/prompts/reasoning-effort/csharp/Program.cs index c026e046d..719650880 100644 --- a/test/scenarios/prompts/reasoning-effort/csharp/Program.cs +++ b/test/scenarios/prompts/reasoning-effort/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/prompts/reasoning-effort/go/main.go b/test/scenarios/prompts/reasoning-effort/go/main.go index ce9ffe508..43c5eb74a 100644 --- a/test/scenarios/prompts/reasoning-effort/go/main.go +++ b/test/scenarios/prompts/reasoning-effort/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/prompts/system-message/csharp/Program.cs b/test/scenarios/prompts/system-message/csharp/Program.cs index 7b13d173c..5f22cb029 100644 --- a/test/scenarios/prompts/system-message/csharp/Program.cs +++ b/test/scenarios/prompts/system-message/csharp/Program.cs @@ -5,7 +5,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/prompts/system-message/go/main.go b/test/scenarios/prompts/system-message/go/main.go index 34e9c7523..aeef76137 100644 --- a/test/scenarios/prompts/system-message/go/main.go +++ b/test/scenarios/prompts/system-message/go/main.go @@ -13,7 +13,7 @@ const piratePrompt = `You are a pirate. Always respond in pirate speak. Say 'Arr func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/sessions/concurrent-sessions/csharp/Program.cs b/test/scenarios/sessions/concurrent-sessions/csharp/Program.cs index f3f1b3688..142bcb268 100644 --- a/test/scenarios/sessions/concurrent-sessions/csharp/Program.cs +++ b/test/scenarios/sessions/concurrent-sessions/csharp/Program.cs @@ -6,7 +6,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/sessions/concurrent-sessions/go/main.go b/test/scenarios/sessions/concurrent-sessions/go/main.go index fa15f445e..02b3f03ae 100644 --- a/test/scenarios/sessions/concurrent-sessions/go/main.go +++ b/test/scenarios/sessions/concurrent-sessions/go/main.go @@ -15,7 +15,7 @@ const robotPrompt = `You are a robot. Always say BEEP BOOP!` func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/sessions/infinite-sessions/csharp/Program.cs b/test/scenarios/sessions/infinite-sessions/csharp/Program.cs index 1c6244e4d..fe281292d 100644 --- a/test/scenarios/sessions/infinite-sessions/csharp/Program.cs +++ b/test/scenarios/sessions/infinite-sessions/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/sessions/infinite-sessions/go/main.go b/test/scenarios/sessions/infinite-sessions/go/main.go index c4c95814c..38090660c 100644 --- a/test/scenarios/sessions/infinite-sessions/go/main.go +++ b/test/scenarios/sessions/infinite-sessions/go/main.go @@ -14,7 +14,7 @@ func float64Ptr(f float64) *float64 { return &f } func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/sessions/session-resume/csharp/Program.cs b/test/scenarios/sessions/session-resume/csharp/Program.cs index 743873afe..adb7b1f12 100644 --- a/test/scenarios/sessions/session-resume/csharp/Program.cs +++ b/test/scenarios/sessions/session-resume/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/sessions/session-resume/go/main.go b/test/scenarios/sessions/session-resume/go/main.go index cf2cb0448..796694ec4 100644 --- a/test/scenarios/sessions/session-resume/go/main.go +++ b/test/scenarios/sessions/session-resume/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/sessions/streaming/csharp/Program.cs b/test/scenarios/sessions/streaming/csharp/Program.cs index b7c1e0ff5..01683df76 100644 --- a/test/scenarios/sessions/streaming/csharp/Program.cs +++ b/test/scenarios/sessions/streaming/csharp/Program.cs @@ -2,7 +2,7 @@ var options = new CopilotClientOptions { - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }; var cliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"); diff --git a/test/scenarios/sessions/streaming/go/main.go b/test/scenarios/sessions/streaming/go/main.go index 0f55ece43..0be9ae031 100644 --- a/test/scenarios/sessions/streaming/go/main.go +++ b/test/scenarios/sessions/streaming/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/custom-agents/csharp/Program.cs b/test/scenarios/tools/custom-agents/csharp/Program.cs index 394de465f..c5c6525f1 100644 --- a/test/scenarios/tools/custom-agents/csharp/Program.cs +++ b/test/scenarios/tools/custom-agents/csharp/Program.cs @@ -5,7 +5,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = cliPath, - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/custom-agents/go/main.go b/test/scenarios/tools/custom-agents/go/main.go index 321793382..1ce90d47e 100644 --- a/test/scenarios/tools/custom-agents/go/main.go +++ b/test/scenarios/tools/custom-agents/go/main.go @@ -11,7 +11,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/mcp-servers/csharp/Program.cs b/test/scenarios/tools/mcp-servers/csharp/Program.cs index 1d5acbd2e..2ee25aacd 100644 --- a/test/scenarios/tools/mcp-servers/csharp/Program.cs +++ b/test/scenarios/tools/mcp-servers/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/mcp-servers/go/main.go b/test/scenarios/tools/mcp-servers/go/main.go index 15ffa4c41..70831cafa 100644 --- a/test/scenarios/tools/mcp-servers/go/main.go +++ b/test/scenarios/tools/mcp-servers/go/main.go @@ -12,7 +12,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/no-tools/csharp/Program.cs b/test/scenarios/tools/no-tools/csharp/Program.cs index d25b57a6c..c3de1de53 100644 --- a/test/scenarios/tools/no-tools/csharp/Program.cs +++ b/test/scenarios/tools/no-tools/csharp/Program.cs @@ -10,7 +10,7 @@ You can only respond with text based on your training data. using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/no-tools/go/main.go b/test/scenarios/tools/no-tools/go/main.go index 75cfa894d..d453f0dfd 100644 --- a/test/scenarios/tools/no-tools/go/main.go +++ b/test/scenarios/tools/no-tools/go/main.go @@ -16,7 +16,7 @@ If asked about your capabilities or tools, clearly state that you have no tools func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/skills/csharp/Program.cs b/test/scenarios/tools/skills/csharp/Program.cs index fc31c2940..38df0dac1 100644 --- a/test/scenarios/tools/skills/csharp/Program.cs +++ b/test/scenarios/tools/skills/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/skills/go/main.go b/test/scenarios/tools/skills/go/main.go index d0d9f8700..e322dda6c 100644 --- a/test/scenarios/tools/skills/go/main.go +++ b/test/scenarios/tools/skills/go/main.go @@ -13,7 +13,7 @@ import ( func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/tool-filtering/csharp/Program.cs b/test/scenarios/tools/tool-filtering/csharp/Program.cs index dfe3b5a93..f21482b1b 100644 --- a/test/scenarios/tools/tool-filtering/csharp/Program.cs +++ b/test/scenarios/tools/tool-filtering/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/tool-filtering/go/main.go b/test/scenarios/tools/tool-filtering/go/main.go index 3c31c198e..a774fb3e8 100644 --- a/test/scenarios/tools/tool-filtering/go/main.go +++ b/test/scenarios/tools/tool-filtering/go/main.go @@ -13,7 +13,7 @@ const systemPrompt = `You are a helpful assistant. You have access to a limited func main() { client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/tools/virtual-filesystem/csharp/Program.cs b/test/scenarios/tools/virtual-filesystem/csharp/Program.cs index 4018b5f99..7dd5d710e 100644 --- a/test/scenarios/tools/virtual-filesystem/csharp/Program.cs +++ b/test/scenarios/tools/virtual-filesystem/csharp/Program.cs @@ -8,7 +8,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/tools/virtual-filesystem/go/main.go b/test/scenarios/tools/virtual-filesystem/go/main.go index 625d999ea..29b1eef4f 100644 --- a/test/scenarios/tools/virtual-filesystem/go/main.go +++ b/test/scenarios/tools/virtual-filesystem/go/main.go @@ -74,7 +74,7 @@ func main() { } client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background() diff --git a/test/scenarios/transport/stdio/csharp/Program.cs b/test/scenarios/transport/stdio/csharp/Program.cs index 50505b776..cb67c903c 100644 --- a/test/scenarios/transport/stdio/csharp/Program.cs +++ b/test/scenarios/transport/stdio/csharp/Program.cs @@ -3,7 +3,7 @@ using var client = new CopilotClient(new CopilotClientOptions { CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"), - GithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), + GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"), }); await client.StartAsync(); diff --git a/test/scenarios/transport/stdio/go/main.go b/test/scenarios/transport/stdio/go/main.go index 5543f6b4d..e548a08e7 100644 --- a/test/scenarios/transport/stdio/go/main.go +++ b/test/scenarios/transport/stdio/go/main.go @@ -12,7 +12,7 @@ import ( func main() { // Go SDK auto-reads COPILOT_CLI_PATH from env client := copilot.NewClient(&copilot.ClientOptions{ - GithubToken: os.Getenv("GITHUB_TOKEN"), + GitHubToken: os.Getenv("GITHUB_TOKEN"), }) ctx := context.Background()