From 379e210aa7ae5fe19d8c0cd561dfebf0717824ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 20:24:50 +0000 Subject: [PATCH 1/2] chore(deps): Bump @github/copilot-sdk from 0.3.0 to 1.0.5 Bumps [@github/copilot-sdk](https://github.com/github/copilot-sdk) from 0.3.0 to 1.0.5. - [Release notes](https://github.com/github/copilot-sdk/releases) - [Changelog](https://github.com/github/copilot-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/copilot-sdk/compare/v0.3.0...v1.0.5) --- updated-dependencies: - dependency-name: "@github/copilot-sdk" dependency-version: 1.0.5 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3dda98..a582364 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "dependencies": { "@azure/msal-node": "^5.1.4", - "@github/copilot-sdk": "^0.3.0", + "@github/copilot-sdk": "^1.0.5", "@hyperlight-dev/js-host-api": "file:deps/js-host-api", "@modelcontextprotocol/sdk": "^1.29.0", "boxen": "^8.0.1", @@ -825,17 +825,17 @@ } }, "node_modules/@github/copilot-sdk": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-0.3.0.tgz", - "integrity": "sha512-SUo35k56pzzgYgwmDPHcu7kZxPrzXbH66IWXaEf6pmb94DlA709F82HrrDeja087TL4djJ9OuvRFWWOKCosAsg==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.5.tgz", + "integrity": "sha512-N6Yk2DcpM9orYXWGBcQs5R0FdiVYrCn7UHQ206cUkfJengKYjgcd3f78BvVB6Dot3j0TvO04FnQ85K9/kbRRag==", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.36-0", + "@github/copilot": "^1.0.67", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, "engines": { - "node": ">=20.0.0" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@github/copilot-win32-arm64": { diff --git a/package.json b/package.json index 0b3ee86..f99df85 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "dependencies": { "@azure/msal-node": "^5.1.4", - "@github/copilot-sdk": "^0.3.0", + "@github/copilot-sdk": "^1.0.5", "@hyperlight-dev/js-host-api": "file:deps/js-host-api", "@modelcontextprotocol/sdk": "^1.29.0", "boxen": "^8.0.1", From 050c25f75babf9086d176ff1ef26501734939941 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Fri, 3 Jul 2026 22:36:02 +0100 Subject: [PATCH 2/2] fixes Signed-off-by: Simon Davies --- src/agent/error-handler.ts | 14 +++++++++----- src/agent/index.ts | 10 +++++----- src/agent/slash-commands.ts | 8 ++++---- src/plugin-system/auditor.ts | 4 ++-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/agent/error-handler.ts b/src/agent/error-handler.ts index b1cd4cf..c8bef8f 100644 --- a/src/agent/error-handler.ts +++ b/src/agent/error-handler.ts @@ -13,7 +13,15 @@ // barrel (index.d.ts), so we define them locally to stay type-safe // without reaching into node_modules internals. -/** Input provided to the onErrorOccurred hook by the SDK. */ +/** + * Input provided to the onErrorOccurred hook by the SDK. + * + * Declared as a minimal structural subset of the SDK's ErrorOccurredHookInput + * (which extends BaseHookInput) — only the fields this handler reads. Keeping it + * a subset means the handler stays assignable to ErrorOccurredHandler as the SDK + * evolves surrounding fields (e.g. 1.0.5 dropped the previously-present + * `cwd`/`timestamp`). + */ interface ErrorOccurredHookInput { /** Human-readable error description. */ error: string; @@ -21,10 +29,6 @@ interface ErrorOccurredHookInput { errorContext: "model_call" | "tool_execution" | "system" | "user_input"; /** Whether the SDK considers this error recoverable. */ recoverable: boolean; - /** Unix timestamp (ms) when the error occurred. */ - timestamp: number; - /** Working directory at time of error. */ - cwd: string; } /** Output returned from the onErrorOccurred hook to tell the SDK what to do. */ diff --git a/src/agent/index.ts b/src/agent/index.ts index 065567f..72fa298 100644 --- a/src/agent/index.ts +++ b/src/agent/index.ts @@ -7439,9 +7439,9 @@ async function main(): Promise { ); } - // Clean up: destroy the session and stop the CLI server + // Clean up: disconnect the session and stop the CLI server if (state.activeSession) { - await state.activeSession.destroy(); + await state.activeSession.disconnect(); state.activeSession = null; } await client.stop(); @@ -7486,13 +7486,13 @@ process.on("SIGINT", async () => { console.log(); } - // Graceful SDK shutdown — destroy session, then stop client + // Graceful SDK shutdown — disconnect session, then stop client // with a timeout fallback to forceStop. if (state.activeSession) { try { - await state.activeSession.destroy(); + await state.activeSession.disconnect(); } catch { - // Best-effort — don't block exit on destroy failure + // Best-effort — don't block exit on disconnect failure } state.activeSession = null; } diff --git a/src/agent/slash-commands.ts b/src/agent/slash-commands.ts index a0f7c33..4822e15 100644 --- a/src/agent/slash-commands.ts +++ b/src/agent/slash-commands.ts @@ -606,7 +606,7 @@ export async function handleSlashCommand( return true; } try { - await state.activeSession.destroy(); + await state.activeSession.disconnect(); state.activeSession = await state.copilotClient.createSession({ sessionId: makeSessionId(), model: state.currentModel, @@ -810,7 +810,7 @@ export async function handleSlashCommand( // If no match, pass through — the SDK will error if invalid } if (state.activeSession) { - await state.activeSession.destroy(); + await state.activeSession.disconnect(); } state.activeSession = await state.copilotClient.resumeSession( targetId, @@ -1007,7 +1007,7 @@ export async function handleSlashCommand( case "/history": { // Display recent conversation messages from the active session. - // Uses the SDK's session.getMessages() to retrieve the full + // Uses the SDK's session.getEvents() to retrieve the full // event log, then filters for user & assistant messages. if (!state.activeSession) { console.log(` ${C.err("❌ No active session.")}`); @@ -1018,7 +1018,7 @@ export async function handleSlashCommand( const showCount = Number.isFinite(histCount) && histCount > 0 ? histCount : 10; try { - const events = await state.activeSession.getMessages(); + const events = await state.activeSession.getEvents(); // Filter to user/assistant messages — skip tool calls, deltas, etc. const messages = events .filter( diff --git a/src/plugin-system/auditor.ts b/src/plugin-system/auditor.ts index ec3c554..85e8d06 100644 --- a/src/plugin-system/auditor.ts +++ b/src/plugin-system/auditor.ts @@ -968,7 +968,7 @@ export async function deepAudit( }; } finally { // Clean up the one-shot audit session. - // SDK's session.destroy() clears local handlers but does NOT + // SDK's session.disconnect() releases local handlers but does NOT // remove the session from client.sessions — the zombie entry // persists and can cause duplicate event dispatch. We must // evict it ourselves. @@ -977,7 +977,7 @@ export async function deepAudit( const auditSessionId = session.sessionId; const sessionsMap = (client as any).sessions as Map | undefined; - await session.destroy(); + await session.disconnect(); sessionsMap?.delete(auditSessionId); } catch { // Best-effort cleanup — don't mask the original error