MCPcopy Index your code
hub / github.com/github/copilot-sdk / deleteSession

Method deleteSession

nodejs/src/client.ts:1904–1920  ·  view source on GitHub ↗

* Permanently deletes a session and all its data from disk, including * conversation history, planning state, and artifacts. * * Unlike CopilotSession.disconnect, which only releases in-memory * resources and preserves session data for later resumption, this method *

(sessionId: string)

Source from the content-addressed store, hash-verified

1902 * ```
1903 */
1904 async deleteSession(sessionId: string): Promise<void> {
1905 if (!this.connection) {
1906 throw new Error("Client not connected");
1907 }
1908
1909 const response = await this.connection.sendRequest("session.delete", {
1910 sessionId,
1911 });
1912
1913 const { success, error } = response as { success: boolean; error?: string };
1914 if (!success) {
1915 throw new Error(`Failed to delete session ${sessionId}: ${error || "Unknown error"}`);
1916 }
1917
1918 // Remove from local sessions map if present
1919 this.sessions.delete(sessionId);
1920 }
1921
1922 /**
1923 * List all available sessions.

Calls 2

sendRequestMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected