1958
return;
1959
}
1960
>
// Defer the idle-session release behind a grace window rather than
agentService.ts
1961
>
// releasing synchronously. A client that reconnects (or re-subscribes)
1962
>
// within the window cancels this via {@link _cancelPendingSessionRelease}
1963
>
// and keeps the live provider SDK session, avoiding a disconnect/resume
1964
>
// churn cycle that races concurrent session operations on the shared
1965
>
// provider runtime. A zero grace releases on the next tick.
1966
>
this._pendingSessionRelease.set(resource, disposableTimeout(() => {
1967
this._pendingSessionRelease.deleteAndDispose(resource);
1968
this._maybeEvictIdleSession(resource);
1970
}
1971