1168
1169
disposeSession(session: URI): Promise<void> {
1170
>
// Routed through {@link _disposeSequencer} so a concurrent
claudeAgent.ts
1171
>
// {@link shutdown} already serializing teardown for this same
1172
>
// session id awaits this work first (and vice versa). When the session
1173
>
// has not yet been materialized, abort the controller (unblocks any
1174
>
// racing `await sdk.startup()`) and drop the record. No SDK contact,
1175
>
// no DB write — symmetric with `createSession`.
1176
>
const sessionId = AgentSession.id(session);
1177
>
return this._disposeSequencer.queue(sessionId, async () => {
1178
>
await this._teardownEntry(sessionId);
1179
>
this._pruneActiveClientHandles(sessionId);
1180
>
});
1181
>
}
1182
1183
/**