1780
1781
async disposeSession(session: URI): Promise<void> {
1782
>
this._logService.trace(`[AgentService] disposeSession: ${session.toString()}`);
agentService.ts
1783
>
const provider = this._findProviderForSession(session);
1784
>
if (provider) {
1785
await this._disposeSession(provider, session);
1786
this._sessionToProvider.delete(session.toString());
1787
this._clearDownloadProgressInterest(session.toString());
1788
}
1789
>
// Remove any worktree this process created for the session (host-owned;
agentService.ts
1790
>
// agents stay unaware).
1791
>
await this._worktree?.removeCreatedWorktree(AgentSession.id(session));
1792
>
this._changesetCoordinator.onSessionDisposed(session.toString());
1793
>
this._sideEffects.cancelSessionTitleGeneration(session.toString());
1794
>
// Remove all subagent sessions for this parent
1795
>
this._sideEffects.removeSubagentSessions(session.toString());
1796
>
this._stateManager.deleteSession(session.toString());
1797
>
// Remove the VS Code per-session data directory (metadata DB + checkpoints) to mirror the SDK-side cleanup
1798
>
// performed by the provider above. No-op when the directory does not exist.
1799
>
await this._sessionDataService.deleteSessionData(session);
1800
>
}
1801
1802
// ---- Protocol methods ---------------------------------------------------