Skip to content

Commit a598777

Browse files
chore(deps): Bump @github/copilot-sdk from 0.3.0 to 1.0.5 (#225)
* 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](github/copilot-sdk@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] <support@github.com> * fixes Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 62c19ed commit a598777

6 files changed

Lines changed: 27 additions & 23 deletions

File tree

‎package-lock.json‎

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

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"dependencies": {
3333
"@azure/msal-node": "^5.1.4",
34-
"@github/copilot-sdk": "^0.3.0",
34+
"@github/copilot-sdk": "^1.0.5",
3535
"@hyperlight-dev/js-host-api": "file:deps/js-host-api",
3636
"@modelcontextprotocol/sdk": "^1.29.0",
3737
"boxen": "^8.0.1",

‎src/agent/error-handler.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@
1313
// barrel (index.d.ts), so we define them locally to stay type-safe
1414
// without reaching into node_modules internals.
1515

16-
/** Input provided to the onErrorOccurred hook by the SDK. */
16+
/**
17+
* Input provided to the onErrorOccurred hook by the SDK.
18+
*
19+
* Declared as a minimal structural subset of the SDK's ErrorOccurredHookInput
20+
* (which extends BaseHookInput) — only the fields this handler reads. Keeping it
21+
* a subset means the handler stays assignable to ErrorOccurredHandler as the SDK
22+
* evolves surrounding fields (e.g. 1.0.5 dropped the previously-present
23+
* `cwd`/`timestamp`).
24+
*/
1725
interface ErrorOccurredHookInput {
1826
/** Human-readable error description. */
1927
error: string;
2028
/** Where the error occurred: model call, tool execution, etc. */
2129
errorContext: "model_call" | "tool_execution" | "system" | "user_input";
2230
/** Whether the SDK considers this error recoverable. */
2331
recoverable: boolean;
24-
/** Unix timestamp (ms) when the error occurred. */
25-
timestamp: number;
26-
/** Working directory at time of error. */
27-
cwd: string;
2832
}
2933

3034
/** Output returned from the onErrorOccurred hook to tell the SDK what to do. */

‎src/agent/index.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7439,9 +7439,9 @@ async function main(): Promise<void> {
74397439
);
74407440
}
74417441

7442-
// Clean up: destroy the session and stop the CLI server
7442+
// Clean up: disconnect the session and stop the CLI server
74437443
if (state.activeSession) {
7444-
await state.activeSession.destroy();
7444+
await state.activeSession.disconnect();
74457445
state.activeSession = null;
74467446
}
74477447
await client.stop();
@@ -7486,13 +7486,13 @@ process.on("SIGINT", async () => {
74867486
console.log();
74877487
}
74887488

7489-
// Graceful SDK shutdown — destroy session, then stop client
7489+
// Graceful SDK shutdown — disconnect session, then stop client
74907490
// with a timeout fallback to forceStop.
74917491
if (state.activeSession) {
74927492
try {
7493-
await state.activeSession.destroy();
7493+
await state.activeSession.disconnect();
74947494
} catch {
7495-
// Best-effort — don't block exit on destroy failure
7495+
// Best-effort — don't block exit on disconnect failure
74967496
}
74977497
state.activeSession = null;
74987498
}

‎src/agent/slash-commands.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ export async function handleSlashCommand(
606606
return true;
607607
}
608608
try {
609-
await state.activeSession.destroy();
609+
await state.activeSession.disconnect();
610610
state.activeSession = await state.copilotClient.createSession({
611611
sessionId: makeSessionId(),
612612
model: state.currentModel,
@@ -810,7 +810,7 @@ export async function handleSlashCommand(
810810
// If no match, pass through — the SDK will error if invalid
811811
}
812812
if (state.activeSession) {
813-
await state.activeSession.destroy();
813+
await state.activeSession.disconnect();
814814
}
815815
state.activeSession = await state.copilotClient.resumeSession(
816816
targetId,
@@ -1007,7 +1007,7 @@ export async function handleSlashCommand(
10071007

10081008
case "/history": {
10091009
// Display recent conversation messages from the active session.
1010-
// Uses the SDK's session.getMessages() to retrieve the full
1010+
// Uses the SDK's session.getEvents() to retrieve the full
10111011
// event log, then filters for user & assistant messages.
10121012
if (!state.activeSession) {
10131013
console.log(` ${C.err("❌ No active session.")}`);
@@ -1018,7 +1018,7 @@ export async function handleSlashCommand(
10181018
const showCount =
10191019
Number.isFinite(histCount) && histCount > 0 ? histCount : 10;
10201020
try {
1021-
const events = await state.activeSession.getMessages();
1021+
const events = await state.activeSession.getEvents();
10221022
// Filter to user/assistant messages — skip tool calls, deltas, etc.
10231023
const messages = events
10241024
.filter(

‎src/plugin-system/auditor.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ export async function deepAudit(
968968
};
969969
} finally {
970970
// Clean up the one-shot audit session.
971-
// SDK's session.destroy() clears local handlers but does NOT
971+
// SDK's session.disconnect() releases local handlers but does NOT
972972
// remove the session from client.sessions — the zombie entry
973973
// persists and can cause duplicate event dispatch. We must
974974
// evict it ourselves.
@@ -977,7 +977,7 @@ export async function deepAudit(
977977
const auditSessionId = session.sessionId;
978978
const sessionsMap = (client as any).sessions as
979979
Map<string, unknown> | undefined;
980-
await session.destroy();
980+
await session.disconnect();
981981
sessionsMap?.delete(auditSessionId);
982982
} catch {
983983
// Best-effort cleanup — don't mask the original error

0 commit comments

Comments
 (0)