diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-20 15:17:54 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-20 15:18:03 +0300 |
| commit | 28b628d79d755afbb3ac45f9184a03c204c26784 (patch) | |
| tree | 93ee9f4c9939430c5e82b22da7c080f99f882fe0 /src/integration/config_edit.rs | |
| parent | 9450b168c727e9e4cbee95e6edf4f11cfe6f2154 (diff) | |
fix: report kimi questions as blocked
Diffstat (limited to 'src/integration/config_edit.rs')
| -rw-r--r-- | src/integration/config_edit.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/integration/config_edit.rs b/src/integration/config_edit.rs index 63c18845..630682ce 100644 --- a/src/integration/config_edit.rs +++ b/src/integration/config_edit.rs @@ -749,18 +749,26 @@ pub(crate) fn build_kimi_config_with_hooks(content: &str, hook_path: &Path) -> S result.push_str(KIMI_CONFIG_BLOCK_BEGIN); result.push('\n'); - for (event, action) in KIMI_HOOK_EVENTS { - result.push_str(&kimi_hook_table(event, hook_path, action)); + for (event, matcher, action) in KIMI_HOOK_EVENTS { + result.push_str(&kimi_hook_table(event, matcher, hook_path, action)); } result.push_str(KIMI_CONFIG_BLOCK_END); result.push('\n'); result } -pub(crate) fn kimi_hook_table(event: &str, hook_path: &Path, action: &str) -> String { +pub(crate) fn kimi_hook_table( + event: &str, + matcher: Option<&str>, + hook_path: &Path, + action: &str, +) -> String { let command = hook_command(hook_path, Some(action)); + let matcher = matcher + .map(|matcher| format!("matcher = {}\n", toml_basic_string(matcher))) + .unwrap_or_default(); format!( - "[[hooks]]\nevent = {}\ncommand = {}\ntimeout = 10\n\n", + "[[hooks]]\nevent = {}\n{matcher}command = {}\ntimeout = 10\n\n", toml_basic_string(event), toml_basic_string(&command) ) |
