Skip to content

Commit 597ddb1

Browse files
fix(server): held delegated results do not keep the caller's MCP session live
A finished delegated task held until its completion wake starts has no provider process behind it, so it is listed without an owning provider instance and isLiveCallerShell keeps rejecting a parent whose run ended.
1 parent 9eed303 commit 597ddb1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/shared/src/orchestrationV2PendingBackgroundWork.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ export function derivePendingBackgroundWork(input: {
279279

280280
for (const item of [
281281
...pendingBackgroundTurnItems(input),
282-
...(input.awaitingWakeTurnItems ?? []),
282+
// A finished task has no provider process, so it must not keep the caller's MCP session live.
283+
...(input.awaitingWakeTurnItems ?? []).map(
284+
({ owningProviderInstanceId: _owner, ...item }) => item,
285+
),
283286
]) {
284287
const taskId = nativeTaskIdFromTurnItem(item);
285288
if (byTaskId.has(taskId)) {

0 commit comments

Comments
 (0)