Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/actions/setup-copilot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ runs:
shell: bash
- name: Set CLI path
id: cli-path
run: echo "path=$(pwd)/nodejs/node_modules/@github/copilot/index.js" >> $GITHUB_OUTPUT
run: |
# As of CLI 1.0.64-1 the @github/copilot package is a thin loader; the
# runnable index.js ships in the installed platform package
# (e.g. @github/copilot-linux-x64). Exactly one is installed.
cli_path=$(ls "$(pwd)"/nodejs/node_modules/@github/copilot-*/index.js 2>/dev/null | head -n1)
if [ -z "$cli_path" ]; then
echo "Could not find @github/copilot platform package (index.js) under nodejs/node_modules" >&2
exit 1
fi
echo "path=$cli_path" >> $GITHUB_OUTPUT
shell: bash
- name: Verify CLI works
run: node ${{ steps.cli-path.outputs.path }} --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: mvn javadoc:javadoc -q

- name: Verify CLI works
run: node ../nodejs/node_modules/@github/copilot/index.js --version
run: node ../nodejs/node_modules/@github/copilot/npm-loader.js --version

- name: Run spotless check
if: matrix.test-jdk == '25'
Expand Down
4 changes: 2 additions & 2 deletions docs/features/image-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func main() {
Prompt: "Describe what you see in this image",
Attachments: []copilot.Attachment{
&copilot.AttachmentBlob{
Data: base64ImageData,
Data: &base64ImageData,
MIMEType: mimeType,
DisplayName: &displayName,
},
Expand All @@ -362,7 +362,7 @@ session.Send(ctx, copilot.MessageOptions{
Prompt: "Describe what you see in this image",
Attachments: []copilot.Attachment{
&copilot.AttachmentBlob{
Data: base64ImageData, // base64-encoded string
Data: &base64ImageData, // base64-encoded string
MIMEType: mimeType,
DisplayName: &displayName,
},
Expand Down
295 changes: 290 additions & 5 deletions dotnet/src/Generated/Rpc.cs

Large diffs are not rendered by default.

607 changes: 543 additions & 64 deletions dotnet/src/Generated/SessionEvents.cs

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions dotnet/test/Harness/E2ETestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,22 @@
var envPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH");
if (!string.IsNullOrEmpty(envPath)) return envPath;

var path = Path.Combine(repoRoot, "nodejs/node_modules/@github/copilot/index.js");
if (!File.Exists(path))
throw new InvalidOperationException($"CLI not found at {path}. Run 'npm install' in the nodejs directory first.");
// As of CLI 1.0.64-1 the @github/copilot package is a thin loader; the
// runnable index.js ships in the installed platform package
// (e.g. @github/copilot-linux-x64). Exactly one is installed.
var githubModules = Path.Combine(repoRoot, "nodejs", "node_modules", "@github");

Check notice

Code scanning / CodeQL

Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note test

Call to 'System.IO.Path.Combine' may silently drop its earlier arguments.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if (Directory.Exists(githubModules))
{
foreach (var dir in Directory.EnumerateDirectories(githubModules, "copilot-*"))
{
var candidate = Path.Combine(dir, "index.js");

Check notice

Code scanning / CodeQL

Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note test

Call to 'System.IO.Path.Combine' may silently drop its earlier arguments.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if (File.Exists(candidate))
return candidate;
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select Note test

This foreach loop immediately
maps its iteration variable to another variable
- consider mapping the sequence explicitly using '.Select(...)'.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
}

return path;
throw new InvalidOperationException(
$"CLI not found under {githubModules}. Run 'npm install' in the nodejs directory first.");
}

public async Task ConfigureForTestAsync(string testFile, [CallerMemberName] string? testName = null)
Expand Down
14 changes: 6 additions & 8 deletions go/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,18 +420,16 @@
}

func findCLIPathForTest() string {
abs, _ := filepath.Abs("../nodejs/node_modules/@github/copilot/index.js")
if fileExistsForTest(abs) {
return abs
base, err := filepath.Abs("../nodejs/node_modules/@github")
if err == nil {
matches, _ := filepath.Glob(filepath.Join(base, "copilot-*", "index.js"))
if len(matches) > 0 {
return matches[0]
}
}
return ""
}

func fileExistsForTest(path string) bool {
_, err := os.Stat(path)
return err == nil
}

func TestCreateSessionRequest_ClientName(t *testing.T) {
t.Run("includes clientName in JSON when set", func(t *testing.T) {
req := createSessionRequest{ClientName: "my-app"}
Expand Down Expand Up @@ -1135,8 +1133,8 @@
if lc.InputPrice == nil || *lc.InputPrice != 4.0 {
t.Errorf("unexpected LongContext.InputPrice: %v", lc.InputPrice)
}
if lc.ContextMax == nil || *lc.ContextMax != 1000000 {

Check failure on line 1136 in go/client_test.go

View workflow job for this annotation

GitHub Actions / Go SDK Tests (ubuntu-latest)

SA1019: lc.ContextMax is deprecated: use maxPromptTokens. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. (staticcheck)
t.Errorf("unexpected LongContext.ContextMax: %v", lc.ContextMax)

Check failure on line 1137 in go/client_test.go

View workflow job for this annotation

GitHub Actions / Go SDK Tests (ubuntu-latest)

SA1019: lc.ContextMax is deprecated: use maxPromptTokens. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. (staticcheck)
}

// Round-trip back to JSON and ensure the nested structure survives.
Expand Down
2 changes: 1 addition & 1 deletion go/internal/e2e/session_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ func TestSessionBlobAttachmentE2E(t *testing.T) {
Prompt: "Describe this image",
Attachments: []copilot.Attachment{
&copilot.AttachmentBlob{
Data: data,
Data: &data,
MIMEType: mimeType,
DisplayName: &displayName,
},
Expand Down
16 changes: 11 additions & 5 deletions go/internal/e2e/testharness/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ func CLIPath() string {
return
}

// Look for CLI in sibling nodejs directory's node_modules
abs, err := filepath.Abs("../../../nodejs/node_modules/@github/copilot/index.js")
if err == nil && fileExists(abs) {
cliPath = abs
return
// Look for CLI in sibling nodejs directory's node_modules. As of CLI
// 1.0.64-1 the @github/copilot package is a thin loader; the runnable
// index.js ships in the installed platform package
// (e.g. @github/copilot-linux-x64).
base, err := filepath.Abs("../../../nodejs/node_modules/@github")
if err == nil {
matches, _ := filepath.Glob(filepath.Join(base, "copilot-*", "index.js"))
if len(matches) > 0 {
cliPath = matches[0]
return
}
}
})
return cliPath
Expand Down
Loading
Loading