diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index ad6bd9578a..dabee37a92 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -2374,7 +2374,7 @@ export class ClineProvider timestamp: exec.timestamp.toISOString(), hookId: exec.hook.id, event: exec.event, - toolName: exec.result.hook.matcher ? undefined : undefined, // Tool name is in context, not easily accessible here + toolName: undefined, // Tool name is in context, not easily accessible here exitCode: exec.result.exitCode, duration: exec.result.duration, timedOut: exec.result.timedOut, diff --git a/src/services/hooks/HookMatcher.ts b/src/services/hooks/HookMatcher.ts index 92fa4cde55..bc24f49a7b 100644 --- a/src/services/hooks/HookMatcher.ts +++ b/src/services/hooks/HookMatcher.ts @@ -43,8 +43,7 @@ function expandGroupPatterns(pattern: string): string { return tools.join("|") } - // Not a group, keep as-is, but warn if it looks like it was intended as a group - console.warn(`Unknown tool group "${pattern}". Treating as literal tool name.`) + // Not a group - this is a normal tool name, keep as-is return pattern } diff --git a/src/services/hooks/__tests__/HookMatcher.spec.ts b/src/services/hooks/__tests__/HookMatcher.spec.ts index 302911a26b..eae2aefe3a 100644 --- a/src/services/hooks/__tests__/HookMatcher.spec.ts +++ b/src/services/hooks/__tests__/HookMatcher.spec.ts @@ -205,19 +205,10 @@ describe("HookMatcher", () => { }) it("should treat unknown groups as literal tool names", () => { - // Mock console.warn to capture warnings - const consoleWarnSpy = vi.spyOn(console, "warn").mockImplementation(() => {}) - + // Unknown group names are treated as literal tool names (no warning) const matcher = compileMatcher("unknown_group") expect(matcher.matches("unknown_group")).toBe(true) expect(matcher.matches("read_file")).toBe(false) - - // Should have warned about unknown group - expect(consoleWarnSpy).toHaveBeenCalledWith( - expect.stringContaining('Unknown tool group "unknown_group"'), - ) - - consoleWarnSpy.mockRestore() }) it("should not warn for glob patterns that look like groups", () => {