Skip to content

Commit 997a73b

Browse files
committed
Support latest .NET
1 parent 49f199a commit 997a73b

138 files changed

Lines changed: 459 additions & 168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dotnet/src/Client.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,15 @@ public CopilotClient(CopilotClientOptions? options = null)
105105
_options = options ?? new();
106106

107107
// Validate mutually exclusive options
108-
if (!string.IsNullOrEmpty(_options.CliUrl) && (_options.UseStdio || _options.CliPath != null))
108+
if (!string.IsNullOrEmpty(_options.CliUrl) && _options.CliPath != null)
109109
{
110-
throw new ArgumentException("CliUrl is mutually exclusive with UseStdio and CliPath");
110+
throw new ArgumentException("CliUrl is mutually exclusive with CliPath");
111+
}
112+
113+
// When CliUrl is provided, disable UseStdio (we connect to an external server, not spawn one)
114+
if (!string.IsNullOrEmpty(_options.CliUrl))
115+
{
116+
_options.UseStdio = false;
111117
}
112118

113119
// Validate auth options with external server

go/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ type SystemMessageConfig struct {
103103
type PermissionRequest struct {
104104
Kind string `json:"kind"`
105105
ToolCallID string `json:"toolCallId,omitempty"`
106+
ToolName string `json:"toolName,omitempty"`
106107
Extra map[string]any `json:"-"` // Additional fields vary by kind
107108
}
108109

test/scenarios/auth/byok-anthropic/csharp/csharp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<RollForward>LatestMajor</RollForward>
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>enable</Nullable>
78
<CopilotSkipCliDownload>true</CopilotSkipCliDownload>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e ../../../../python
1+
-e ../../../../../python

test/scenarios/auth/byok-anthropic/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "node dist/index.js"
1010
},
1111
"dependencies": {
12-
"@github/copilot-sdk": "file:../../../../nodejs"
12+
"@github/copilot-sdk": "file:../../../../../nodejs"
1313
},
1414
"devDependencies": {
1515
"@types/node": "^20.0.0",

test/scenarios/auth/byok-anthropic/verify.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ check "TypeScript (build)" bash -c "cd '$SCRIPT_DIR/typescript' && npm run build
7373
check "C# (build)" bash -c "cd '$SCRIPT_DIR/csharp' && dotnet build --nologo -v q 2>&1"
7474

7575
if [ "${BYOK_SAMPLE_RUN_E2E:-}" = "1" ] && [ -n "${ANTHROPIC_API_KEY:-}" ]; then
76-
run_with_timeout "TypeScript (run)" bash -c "cd '$SCRIPT_DIR/typescript' && node dist/index.js"
77-
run_with_timeout "C# (run)" bash -c "cd '$SCRIPT_DIR/csharp' && dotnet run --no-build 2>&1"
76+
run_with_timeout "TypeScript (run)" bash -c "
77+
cd '$SCRIPT_DIR/typescript' && \
78+
output=\$(node dist/index.js 2>&1) && \
79+
echo \"\$output\" && \
80+
echo \"\$output\" | grep -qi 'Paris\|capital\|France\|response\|hello'
81+
"
82+
run_with_timeout "C# (run)" bash -c "
83+
cd '$SCRIPT_DIR/csharp' && \
84+
output=\$(dotnet run --no-build 2>&1) && \
85+
echo \"\$output\" && \
86+
echo \"\$output\" | grep -qi 'Paris\|capital\|France\|response\|hello'
87+
"
7888
else
7989
echo "⚠️ WARNING: E2E run was SKIPPED — only build was verified, not runtime behavior."
8090
echo " To run fully: set BYOK_SAMPLE_RUN_E2E=1 and ANTHROPIC_API_KEY."

test/scenarios/auth/byok-azure/csharp/csharp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<RollForward>LatestMajor</RollForward>
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>enable</Nullable>
78
<CopilotSkipCliDownload>true</CopilotSkipCliDownload>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e ../../../../python
1+
-e ../../../../../python

test/scenarios/auth/byok-azure/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "node dist/index.js"
1010
},
1111
"dependencies": {
12-
"@github/copilot-sdk": "file:../../../../nodejs"
12+
"@github/copilot-sdk": "file:../../../../../nodejs"
1313
},
1414
"devDependencies": {
1515
"@types/node": "^20.0.0",

test/scenarios/auth/byok-azure/verify.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ check "TypeScript (build)" bash -c "cd '$SCRIPT_DIR/typescript' && npm run build
7373
check "C# (build)" bash -c "cd '$SCRIPT_DIR/csharp' && dotnet build --nologo -v q 2>&1"
7474

7575
if [ -n "${AZURE_OPENAI_ENDPOINT:-}" ] && [ -n "${AZURE_OPENAI_API_KEY:-}" ]; then
76-
run_with_timeout "TypeScript (run)" bash -c "cd '$SCRIPT_DIR/typescript' && node dist/index.js"
77-
run_with_timeout "C# (run)" bash -c "cd '$SCRIPT_DIR/csharp' && dotnet run --no-build 2>&1"
76+
run_with_timeout "TypeScript (run)" bash -c "
77+
cd '$SCRIPT_DIR/typescript' && \
78+
output=\$(node dist/index.js 2>&1) && \
79+
echo \"\$output\" && \
80+
echo \"\$output\" | grep -qi 'Paris\|capital\|France\|response\|hello'
81+
"
82+
run_with_timeout "C# (run)" bash -c "
83+
cd '$SCRIPT_DIR/csharp' && \
84+
output=\$(dotnet run --no-build 2>&1) && \
85+
echo \"\$output\" && \
86+
echo \"\$output\" | grep -qi 'Paris\|capital\|France\|response\|hello'
87+
"
7888
else
7989
echo "⚠️ WARNING: E2E run was SKIPPED — only build was verified, not runtime behavior."
8090
echo " To run fully: set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY."

0 commit comments

Comments
 (0)