Skip to content

Commit 97f9d8e

Browse files
committed
Fix Rust hook e2e test isolation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5946de6 commit 97f9d8e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

rust/tests/e2e/hooks_extended.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,16 @@ impl SessionHooks for RecordingHooks {
522522
input: PostToolUseInput,
523523
_ctx: HookContext,
524524
) -> Option<PostToolUseOutput> {
525-
let output = (input.tool_name == "report_intent").then(|| PostToolUseOutput {
526-
modified_result: Some(json!({
527-
"textResultForLlm": "modified by post hook",
528-
"resultType": "success",
529-
"toolTelemetry": {},
530-
})),
531-
suppress_output: Some(false),
532-
..PostToolUseOutput::default()
525+
let output = (self.post_tool.is_some() && input.tool_name == "report_intent").then(|| {
526+
PostToolUseOutput {
527+
modified_result: Some(json!({
528+
"textResultForLlm": "modified by post hook",
529+
"resultType": "success",
530+
"toolTelemetry": {},
531+
})),
532+
suppress_output: Some(false),
533+
..PostToolUseOutput::default()
534+
}
533535
});
534536
if let Some(tx) = &self.post_tool {
535537
let _ = tx.send(input);

0 commit comments

Comments
 (0)