Skip to content

Commit 18b8723

Browse files
committed
fix(embedded-agent-runner): remove unused wrapRetryStreamWithRecoveryNotification
The function was replaced by pumpStreamWithRecovery + retryStreamWithoutThinking in the async stream refactor but the old wrapper was left as dead code.
1 parent 2025ee5 commit 18b8723

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

src/agents/embedded-agent-runner/thinking.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -602,34 +602,6 @@ function isSuccessfulRecoveryRetryResult(message: AssistantMessage | undefined):
602602
return message.stopReason !== "error" && message.stopReason !== "aborted";
603603
}
604604

605-
function wrapRetryStreamWithRecoveryNotification(
606-
retryStream: ReturnType<StreamFn>,
607-
notify: () => Promise<void>,
608-
): ReturnType<StreamFn> {
609-
if (retryStream instanceof Promise) {
610-
return retryStream.then((resolved) =>
611-
wrapRetryStreamWithRecoveryNotification(resolved as ReturnType<StreamFn>, notify),
612-
) as ReturnType<StreamFn>;
613-
}
614-
const streamWithResult = retryStream as unknown as {
615-
result?: () => Promise<AssistantMessage>;
616-
};
617-
if (typeof streamWithResult.result !== "function") {
618-
return retryStream;
619-
}
620-
const result = streamWithResult.result.bind(streamWithResult);
621-
let notified = false;
622-
streamWithResult.result = async () => {
623-
const message = await result();
624-
if (!notified && isSuccessfulRecoveryRetryResult(message)) {
625-
notified = true;
626-
await notify();
627-
}
628-
return message;
629-
};
630-
return retryStream;
631-
}
632-
633605
async function retryStreamWithoutThinking(
634606
outer: ReturnType<typeof createAssistantMessageEventStream>,
635607
retry: () => ReturnType<StreamFn>,

0 commit comments

Comments
 (0)