feat(notification): alert when agent asks questions or needs permission

This commit is contained in:
acamq
2026-02-21 15:49:23 -07:00
parent 08ba7ca0c8
commit aae4363b56
4 changed files with 254 additions and 8 deletions
+19
View File
@@ -30,6 +30,25 @@ export function createToolExecuteBeforeHandler(args: {
await hooks.prometheusMdOnly?.["tool.execute.before"]?.(input, output)
await hooks.sisyphusJuniorNotepad?.["tool.execute.before"]?.(input, output)
await hooks.atlasHook?.["tool.execute.before"]?.(input, output)
const normalizedToolName = input.tool.toLowerCase()
if (
normalizedToolName === "question"
|| normalizedToolName === "ask_user_question"
|| normalizedToolName === "askuserquestion"
) {
await hooks.sessionNotification?.({
event: {
type: "tool.execute.before",
properties: {
sessionID: input.sessionID,
tool: input.tool,
args: output.args,
},
},
})
}
if (input.tool === "task") {
const argsObject = output.args
const category = typeof argsObject.category === "string" ? argsObject.category : undefined