@github/copilot-sdk 1.0.29-preview.7 → 1.0.29-preview.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ __export(cliVersion_exports, {
22
22
  COPILOT_CLI_VERSION: () => COPILOT_CLI_VERSION
23
23
  });
24
24
  module.exports = __toCommonJS(cliVersion_exports);
25
- const COPILOT_CLI_VERSION = "1.0.106-8";
25
+ const COPILOT_CLI_VERSION = "1.0.106-9";
26
26
  const COPILOT_CLI_USE_NPM_PACKAGE = false;
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
@@ -815,12 +815,17 @@ class CopilotClient {
815
815
  * Stops the CLI server and closes all active sessions.
816
816
  *
817
817
  * This method performs graceful cleanup:
818
- * 1. Closes all active sessions (releases in-memory resources)
818
+ * 1. Closes all active sessions (releases in-memory resources); detach
819
+ * requests share one shutdown timeout
819
820
  * 2. Requests runtime shutdown for SDK-owned CLI processes
820
821
  * 3. Closes the JSON-RPC connection
821
822
  * 4. Signals EOF to an owned stdio process and waits for host cleanup, then
822
823
  * terminates the process if it does not exit within the shutdown timeout
823
824
  *
825
+ * In-process connections first abort active turns without a timeout. That
826
+ * step is outside the detach deadline, so in-process stop() can still wait
827
+ * indefinitely if the runtime stops answering abort requests.
828
+ *
824
829
  * Note: session data on disk is preserved, so sessions can be resumed later.
825
830
  * To permanently remove session data before stopping, call
826
831
  * {@link deleteSession} for each session first.
@@ -842,16 +847,31 @@ class CopilotClient {
842
847
  if (this.connectionConfig.kind === "inprocess") {
843
848
  await Promise.allSettled(activeSessions.map((session) => session.abort()));
844
849
  }
850
+ let detachDeadlineTimer;
851
+ const detachDeadline = new Promise((resolve2) => {
852
+ detachDeadlineTimer = setTimeout(() => resolve2("timeout"), RUNTIME_SHUTDOWN_TIMEOUT_MS);
853
+ });
845
854
  for (const session of activeSessions) {
846
855
  const sessionId = session.sessionId;
847
856
  let lastError = null;
857
+ let attempts = 0;
848
858
  for (let attempt = 1; attempt <= 3; attempt++) {
849
859
  if (this.connectionClosed) {
850
860
  lastError = null;
851
861
  break;
852
862
  }
863
+ attempts = attempt;
853
864
  try {
854
- await session.disconnect();
865
+ const outcome = await Promise.race([
866
+ session.disconnect().then(() => "disconnected"),
867
+ detachDeadline
868
+ ]);
869
+ if (outcome === "timeout") {
870
+ lastError = new Error(
871
+ `session.detach did not complete within the ${RUNTIME_SHUTDOWN_TIMEOUT_MS}ms shutdown timeout`
872
+ );
873
+ break;
874
+ }
855
875
  lastError = null;
856
876
  break;
857
877
  } catch (error) {
@@ -869,11 +889,12 @@ class CopilotClient {
869
889
  if (lastError) {
870
890
  errors.push(
871
891
  new Error(
872
- `Failed to disconnect session ${sessionId} after 3 attempts: ${lastError.message}`
892
+ `Failed to disconnect session ${sessionId} after ${attempts} ${attempts === 1 ? "attempt" : "attempts"}: ${lastError.message}`
873
893
  )
874
894
  );
875
895
  }
876
896
  }
897
+ clearTimeout(detachDeadlineTimer);
877
898
  for (const session of activeSessions) {
878
899
  session._markDisconnected();
879
900
  }
@@ -1,2 +1,2 @@
1
- export declare const COPILOT_CLI_VERSION = "1.0.106-8";
1
+ export declare const COPILOT_CLI_VERSION = "1.0.106-9";
2
2
  export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
@@ -1,4 +1,4 @@
1
- const COPILOT_CLI_VERSION = "1.0.106-8";
1
+ const COPILOT_CLI_VERSION = "1.0.106-9";
2
2
  const COPILOT_CLI_USE_NPM_PACKAGE = false;
3
3
  export {
4
4
  COPILOT_CLI_USE_NPM_PACKAGE,
package/dist/client.d.ts CHANGED
@@ -139,12 +139,17 @@ export declare class CopilotClient {
139
139
  * Stops the CLI server and closes all active sessions.
140
140
  *
141
141
  * This method performs graceful cleanup:
142
- * 1. Closes all active sessions (releases in-memory resources)
142
+ * 1. Closes all active sessions (releases in-memory resources); detach
143
+ * requests share one shutdown timeout
143
144
  * 2. Requests runtime shutdown for SDK-owned CLI processes
144
145
  * 3. Closes the JSON-RPC connection
145
146
  * 4. Signals EOF to an owned stdio process and waits for host cleanup, then
146
147
  * terminates the process if it does not exit within the shutdown timeout
147
148
  *
149
+ * In-process connections first abort active turns without a timeout. That
150
+ * step is outside the detach deadline, so in-process stop() can still wait
151
+ * indefinitely if the runtime stops answering abort requests.
152
+ *
148
153
  * Note: session data on disk is preserved, so sessions can be resumed later.
149
154
  * To permanently remove session data before stopping, call
150
155
  * {@link deleteSession} for each session first.
package/dist/client.js CHANGED
@@ -797,12 +797,17 @@ class CopilotClient {
797
797
  * Stops the CLI server and closes all active sessions.
798
798
  *
799
799
  * This method performs graceful cleanup:
800
- * 1. Closes all active sessions (releases in-memory resources)
800
+ * 1. Closes all active sessions (releases in-memory resources); detach
801
+ * requests share one shutdown timeout
801
802
  * 2. Requests runtime shutdown for SDK-owned CLI processes
802
803
  * 3. Closes the JSON-RPC connection
803
804
  * 4. Signals EOF to an owned stdio process and waits for host cleanup, then
804
805
  * terminates the process if it does not exit within the shutdown timeout
805
806
  *
807
+ * In-process connections first abort active turns without a timeout. That
808
+ * step is outside the detach deadline, so in-process stop() can still wait
809
+ * indefinitely if the runtime stops answering abort requests.
810
+ *
806
811
  * Note: session data on disk is preserved, so sessions can be resumed later.
807
812
  * To permanently remove session data before stopping, call
808
813
  * {@link deleteSession} for each session first.
@@ -824,16 +829,31 @@ class CopilotClient {
824
829
  if (this.connectionConfig.kind === "inprocess") {
825
830
  await Promise.allSettled(activeSessions.map((session) => session.abort()));
826
831
  }
832
+ let detachDeadlineTimer;
833
+ const detachDeadline = new Promise((resolve2) => {
834
+ detachDeadlineTimer = setTimeout(() => resolve2("timeout"), RUNTIME_SHUTDOWN_TIMEOUT_MS);
835
+ });
827
836
  for (const session of activeSessions) {
828
837
  const sessionId = session.sessionId;
829
838
  let lastError = null;
839
+ let attempts = 0;
830
840
  for (let attempt = 1; attempt <= 3; attempt++) {
831
841
  if (this.connectionClosed) {
832
842
  lastError = null;
833
843
  break;
834
844
  }
845
+ attempts = attempt;
835
846
  try {
836
- await session.disconnect();
847
+ const outcome = await Promise.race([
848
+ session.disconnect().then(() => "disconnected"),
849
+ detachDeadline
850
+ ]);
851
+ if (outcome === "timeout") {
852
+ lastError = new Error(
853
+ `session.detach did not complete within the ${RUNTIME_SHUTDOWN_TIMEOUT_MS}ms shutdown timeout`
854
+ );
855
+ break;
856
+ }
837
857
  lastError = null;
838
858
  break;
839
859
  } catch (error) {
@@ -851,11 +871,12 @@ class CopilotClient {
851
871
  if (lastError) {
852
872
  errors.push(
853
873
  new Error(
854
- `Failed to disconnect session ${sessionId} after 3 attempts: ${lastError.message}`
874
+ `Failed to disconnect session ${sessionId} after ${attempts} ${attempts === 1 ? "attempt" : "attempts"}: ${lastError.message}`
855
875
  )
856
876
  );
857
877
  }
858
878
  }
879
+ clearTimeout(detachDeadlineTimer);
859
880
  for (const session of activeSessions) {
860
881
  session._markDisconnected();
861
882
  }
@@ -116,6 +116,10 @@ export interface RuntimeLifecycleProgressStateDiagnosticEvent {
116
116
  * Experimental, observational-only state of runtime progress and the lifecycle operations that block it. Observation and delivery never control runtime or model behavior. Process death, diagnostic projection loss, transport loss, or serialization failure can prevent external delivery.
117
117
  */
118
118
  export interface RuntimeLifecycleProgressStateData {
119
+ /**
120
+ * Agent that owns this progress. Absent for the primary agent and progress without an agent owner.
121
+ */
122
+ agentId?: string;
119
123
  /**
120
124
  * Complete dependency blocker set after this progress change.
121
125
  */
package/package.json CHANGED
@@ -5,8 +5,8 @@
5
5
  "url": "https://github.com/github/copilot-agent-runtime.git",
6
6
  "directory": "src/sdk/nodejs"
7
7
  },
8
- "version": "1.0.29-preview.7",
9
- "copilotCliVersion": "1.0.106-8",
8
+ "version": "1.0.29-preview.8",
9
+ "copilotCliVersion": "1.0.106-9",
10
10
  "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
11
11
  "main": "./dist/cjs/index.js",
12
12
  "types": "./dist/index.d.ts",
@@ -117,18 +117,18 @@
117
117
  "README.md"
118
118
  ],
119
119
  "copilotRuntime": {
120
- "sourceSha": "fc20da543d03b6522fc0ac5fefc724be82045156",
121
- "version": "1.0.106-8",
120
+ "sourceSha": "748c6af611e01288d99b688f61267884cb35ef25",
121
+ "version": "1.0.106-9",
122
122
  "visibility": "public"
123
123
  },
124
124
  "optionalDependencies": {
125
- "@github/copilot-sdk-darwin-arm64": "1.0.29-preview.7",
126
- "@github/copilot-sdk-darwin-x64": "1.0.29-preview.7",
127
- "@github/copilot-sdk-linux-arm64": "1.0.29-preview.7",
128
- "@github/copilot-sdk-linux-x64": "1.0.29-preview.7",
129
- "@github/copilot-sdk-linuxmusl-arm64": "1.0.29-preview.7",
130
- "@github/copilot-sdk-linuxmusl-x64": "1.0.29-preview.7",
131
- "@github/copilot-sdk-win32-arm64": "1.0.29-preview.7",
132
- "@github/copilot-sdk-win32-x64": "1.0.29-preview.7"
125
+ "@github/copilot-sdk-darwin-arm64": "1.0.29-preview.8",
126
+ "@github/copilot-sdk-darwin-x64": "1.0.29-preview.8",
127
+ "@github/copilot-sdk-linux-arm64": "1.0.29-preview.8",
128
+ "@github/copilot-sdk-linux-x64": "1.0.29-preview.8",
129
+ "@github/copilot-sdk-linuxmusl-arm64": "1.0.29-preview.8",
130
+ "@github/copilot-sdk-linuxmusl-x64": "1.0.29-preview.8",
131
+ "@github/copilot-sdk-win32-arm64": "1.0.29-preview.8",
132
+ "@github/copilot-sdk-win32-x64": "1.0.29-preview.8"
133
133
  }
134
134
  }