add persisted pi workflow extension
This commit is contained in:
@@ -18,6 +18,7 @@ export const CHILD_EXCLUDED_TOOL_NAMES = [
|
||||
"subagent_check",
|
||||
"subagent_list",
|
||||
"workflow",
|
||||
"pi_workflow",
|
||||
"ask_user",
|
||||
] as const;
|
||||
|
||||
@@ -92,7 +93,10 @@ export interface DisposableChildSession {
|
||||
|
||||
const childShutdowns = new WeakMap<object, Promise<void>>();
|
||||
|
||||
function waitBounded(operation: Promise<unknown>, timeoutMs: number) {
|
||||
export function waitForChildOperation(
|
||||
operation: Promise<unknown>,
|
||||
timeoutMs = CHILD_SHUTDOWN_TIMEOUT_MS,
|
||||
) {
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
const timeout = new Promise<void>((resolve) => {
|
||||
timer = setTimeout(resolve, timeoutMs);
|
||||
@@ -124,7 +128,7 @@ export function shutdownAndDisposeChildSession(
|
||||
const shutdown = (async () => {
|
||||
try {
|
||||
if (session.extensionRunner.hasHandlers("session_shutdown")) {
|
||||
await waitBounded(
|
||||
await waitForChildOperation(
|
||||
session.extensionRunner.emit({
|
||||
type: "session_shutdown",
|
||||
reason: "quit",
|
||||
|
||||
Reference in New Issue
Block a user