fix(async): prevent missed async errors from bypassing catch handlers (#13714)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
CHAEWAN KIM
2025-12-02 07:11:40 +09:00
committed by GitHub
parent 0c463e664e
commit f4babf172b
25 changed files with 102 additions and 117 deletions
+11 -11
View File
@@ -268,7 +268,7 @@ export class HookEventHandler {
};
const context: HookEventContext = { toolName };
return await this.executeHooks(HookEventName.BeforeTool, input, context);
return this.executeHooks(HookEventName.BeforeTool, input, context);
}
/**
@@ -288,7 +288,7 @@ export class HookEventHandler {
};
const context: HookEventContext = { toolName };
return await this.executeHooks(HookEventName.AfterTool, input, context);
return this.executeHooks(HookEventName.AfterTool, input, context);
}
/**
@@ -301,7 +301,7 @@ export class HookEventHandler {
prompt,
};
return await this.executeHooks(HookEventName.BeforeAgent, input);
return this.executeHooks(HookEventName.BeforeAgent, input);
}
/**
@@ -319,7 +319,7 @@ export class HookEventHandler {
details,
};
return await this.executeHooks(HookEventName.Notification, input);
return this.executeHooks(HookEventName.Notification, input);
}
/**
@@ -338,7 +338,7 @@ export class HookEventHandler {
stop_hook_active: stopHookActive,
};
return await this.executeHooks(HookEventName.AfterAgent, input);
return this.executeHooks(HookEventName.AfterAgent, input);
}
/**
@@ -353,7 +353,7 @@ export class HookEventHandler {
};
const context: HookEventContext = { trigger: source };
return await this.executeHooks(HookEventName.SessionStart, input, context);
return this.executeHooks(HookEventName.SessionStart, input, context);
}
/**
@@ -368,7 +368,7 @@ export class HookEventHandler {
};
const context: HookEventContext = { trigger: reason };
return await this.executeHooks(HookEventName.SessionEnd, input, context);
return this.executeHooks(HookEventName.SessionEnd, input, context);
}
/**
@@ -383,7 +383,7 @@ export class HookEventHandler {
};
const context: HookEventContext = { trigger };
return await this.executeHooks(HookEventName.PreCompress, input, context);
return this.executeHooks(HookEventName.PreCompress, input, context);
}
/**
@@ -398,7 +398,7 @@ export class HookEventHandler {
llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest),
};
return await this.executeHooks(HookEventName.BeforeModel, input);
return this.executeHooks(HookEventName.BeforeModel, input);
}
/**
@@ -415,7 +415,7 @@ export class HookEventHandler {
llm_response: defaultHookTranslator.toHookLLMResponse(llmResponse),
};
return await this.executeHooks(HookEventName.AfterModel, input);
return this.executeHooks(HookEventName.AfterModel, input);
}
/**
@@ -430,7 +430,7 @@ export class HookEventHandler {
llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest),
};
return await this.executeHooks(HookEventName.BeforeToolSelection, input);
return this.executeHooks(HookEventName.BeforeToolSelection, input);
}
/**