Skip to content

Commit 35673cb

Browse files
Add in-process (FFI) transport for the Node.js SDK (#1953)
1 parent 09b2a63 commit 35673cb

31 files changed

Lines changed: 1329 additions & 379 deletions

.github/workflows/nodejs-sdk-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ permissions:
3131

3232
jobs:
3333
test:
34-
name: "Node.js SDK Tests"
34+
name: "Node.js SDK Tests (${{ matrix.os }}, ${{ matrix.transport }})"
3535
if: github.event.repository.fork == false
3636
env:
3737
POWERSHELL_UPDATECHECK: Off
3838
strategy:
3939
fail-fast: false
4040
matrix:
4141
os: [ubuntu-latest, macos-latest, windows-latest]
42+
transport: ["default", "inprocess"]
4243
runs-on: ${{ matrix.os }}
4344
defaults:
4445
run:
@@ -75,6 +76,11 @@ jobs:
7576
if: runner.os == 'Windows'
7677
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
7778

79+
- name: Select inprocess transport
80+
if: matrix.transport == 'inprocess'
81+
run: |
82+
echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
83+
7884
- name: Run Node.js SDK tests
7985
env:
8086
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}

dotnet/src/FfiRuntimeHost.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ private static byte[] BuildArgvJson(string cliEntrypoint)
167167
}
168168
writer.WriteStringValue(cliEntrypoint);
169169
writer.WriteStringValue("--embedded-host");
170+
// Pin the worker to the bundled pkg matching the loaded cdylib, instead of
171+
// drifting to a newer version under the user's ~/.copilot/pkg (ABI skew).
172+
writer.WriteStringValue("--no-auto-update");
170173
writer.WriteEndArray();
171174
}
172175
return stream.ToArray();

nodejs/package-lock.json

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"license": "MIT",
5858
"dependencies": {
5959
"@github/copilot": "^1.0.70-0",
60+
"koffi": "^3.1.0",
6061
"vscode-jsonrpc": "^8.2.1",
6162
"zod": "^4.3.6"
6263
},

0 commit comments

Comments
 (0)