You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bring the Node SDK to parity with .NET and Python on the transport env API:
- Factor a shared ChildProcessRuntimeConnection base interface for the
stdio/tcp transports and give it a per-connection `env`, exposed via
forStdio/forTcp. Connection-level env takes precedence over the client-level
env, which falls back to process.env.
- Reject at construction: `env` or `telemetry` with forInProcess() (the shared
host process can't carry per-client values; workingDirectory was already
rejected), and `env` set on both the client and the connection for
child-process transports.
- Unit tests for all guards + precedence; README documents the connection env
and in-process restrictions.
Also drop the redundant "coherent only for child-process transports" phrasing
from the Python connection env docstring (it's attached to the child-process
base already).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a96d1a82-c80e-40f1-a3df-a9708429b68b
Copy file name to clipboardExpand all lines: nodejs/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,11 @@ new CopilotClient(options?: CopilotClientOptions)
84
84
**Options:**
85
85
86
86
-`connection?: RuntimeConnection` - How to connect to the Copilot runtime. Construct via the factory functions on `RuntimeConnection`:
87
-
-`RuntimeConnection.forStdio({ path?, args? })` (default) — spawn the runtime and communicate over its stdin/stdout.
88
-
-`RuntimeConnection.forTcp({ port?, connectionToken?, path?, args? })` — spawn the runtime as a TCP server.
87
+
-`RuntimeConnection.forStdio({ path?, args?, env? })` (default) — spawn the runtime and communicate over its stdin/stdout.
88
+
-`RuntimeConnection.forTcp({ port?, connectionToken?, path?, args?, env? })` — spawn the runtime as a TCP server.
89
89
-`RuntimeConnection.forUri(url, { connectionToken? })` — connect to an already-running runtime (mutually exclusive with `gitHubToken`/`useLoggedInUser`). There is no top-level `cliUrl` shortcut; use this factory for URL-based connections.
90
+
-`RuntimeConnection.forInProcess()` — host the runtime in-process over its native C ABI (FFI). **Experimental.** Because the runtime shares this process, `env`, `telemetry`, and `workingDirectory` are rejected with this transport; set them on the host process instead.
91
+
- The child-process transports (`forStdio`/`forTcp`) also accept a per-connection `env`. Set it there or via the top-level `env` option — not both (setting both throws).
90
92
-`mode?: "empty" | "copilot-cli"` - Defaulting strategy. Use `"empty"` for multi-user server mode; defaults to `"copilot-cli"`.
91
93
-`workingDirectory?: string` - Working directory for the runtime process (default: current process cwd).
92
94
-`baseDirectory?: string` - Base directory for Copilot data (session state, config, etc.). Sets `COPILOT_HOME` on the spawned runtime. When not set, the runtime defaults to `~/.copilot`. Ignored when connecting via `RuntimeConnection.forUri`.
0 commit comments