From 28b628d79d755afbb3ac45f9184a03c204c26784 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 20 Jul 2026 15:17:54 +0300 Subject: fix: report kimi questions as blocked --- src/integration/mod.rs | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'src/integration/mod.rs') diff --git a/src/integration/mod.rs b/src/integration/mod.rs index fdc1c5bd..73c23fc6 100644 --- a/src/integration/mod.rs +++ b/src/integration/mod.rs @@ -58,20 +58,37 @@ const KIMI_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/kimi/herdr-agent-state.sh") }; -const KIMI_INTEGRATION_VERSION: u32 = 4; +const KIMI_INTEGRATION_VERSION: u32 = 5; const KIMI_CONFIG_BLOCK_BEGIN: &str = "# >>> herdr kimi integration"; const KIMI_CONFIG_BLOCK_END: &str = "# <<< herdr kimi integration"; const KIMI_MIN_VERSION: &str = "0.14.0"; -const KIMI_HOOK_EVENTS: [(&str, &str); 9] = [ - ("SessionStart", "session"), - ("UserPromptSubmit", "working"), - ("PreToolUse", "working"), - ("SubagentStart", "working"), - ("PreCompact", "working"), - ("PermissionRequest", "blocked"), - ("PermissionResult", "working"), - ("Stop", "idle"), - ("Interrupt", "idle"), +const KIMI_ASK_USER_QUESTION_MATCHER: &str = "^AskUserQuestion$"; +const KIMI_OTHER_TOOL_MATCHER: &str = "^(?!AskUserQuestion$).*$"; +const KIMI_HOOK_EVENTS: [(&str, Option<&str>, &str); 12] = [ + ("SessionStart", None, "session"), + ("UserPromptSubmit", None, "working"), + ("PreToolUse", Some(KIMI_OTHER_TOOL_MATCHER), "working"), + ( + "PreToolUse", + Some(KIMI_ASK_USER_QUESTION_MATCHER), + "blocked", + ), + ( + "PostToolUse", + Some(KIMI_ASK_USER_QUESTION_MATCHER), + "working", + ), + ( + "PostToolUseFailure", + Some(KIMI_ASK_USER_QUESTION_MATCHER), + "working", + ), + ("SubagentStart", None, "working"), + ("PreCompact", None, "working"), + ("PermissionRequest", None, "blocked"), + ("PermissionResult", None, "working"), + ("Stop", None, "idle"), + ("Interrupt", None, "idle"), ]; const COPILOT_HOOK_INSTALL_NAME: &str = if cfg!(windows) { "herdr-agent-state.ps1" -- cgit v1.2.3