@@ -208,7 +208,18 @@ private void verifyProtocolVersion(Connection connection) throws Exception {
208208 }
209209
210210 /**
211- * Stops the client and closes all sessions.
211+ * Disconnects from the Copilot server and closes all active sessions.
212+ * <p>
213+ * This method performs graceful cleanup:
214+ * <ol>
215+ * <li>Closes all active sessions (releases in-memory resources)</li>
216+ * <li>Closes the JSON-RPC connection</li>
217+ * <li>Terminates the CLI server process (if spawned by this client)</li>
218+ * </ol>
219+ * <p>
220+ * Note: session data on disk is preserved, so sessions can be resumed later. To
221+ * permanently remove session data before stopping, call
222+ * {@link #deleteSession(String)} for each session first.
212223 *
213224 * @return A future that completes when the client is stopped
214225 */
@@ -469,9 +480,12 @@ public CompletableFuture<String> getLastSessionId() {
469480 }
470481
471482 /**
472- * Deletes a session by ID.
483+ * Permanently deletes a session and all its data from disk, including
484+ * conversation history, planning state, and artifacts.
473485 * <p>
474- * This permanently removes the session and its conversation history.
486+ * Unlike {@link CopilotSession#close()}, which only releases in-memory
487+ * resources and preserves session data for later resumption, this method is
488+ * irreversible. The session cannot be resumed after deletion.
475489 *
476490 * @param sessionId
477491 * the ID of the session to delete
0 commit comments