From c5f651c0a9160646c4cf62a36d8243ec9b7a15b7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 8 Dec 2025 14:04:49 +0900 Subject: [PATCH] refactor(hooks): remove grep-blocker (grep tool now overrides built-in) The grep tool now properly overrides OpenCode's built-in grep, making the blocker hook unnecessary. Generated by [OpenCode](https://opencode.ai/) --- src/hooks/grep-blocker.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/hooks/grep-blocker.ts diff --git a/src/hooks/grep-blocker.ts b/src/hooks/grep-blocker.ts deleted file mode 100644 index 53db0da..0000000 --- a/src/hooks/grep-blocker.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { PluginInput } from "@opencode-ai/plugin" - -const BLOCKED_MESSAGE = - "Error: [BLOCKED] grep has no timeout and can freeze the system. " + - "It is permanently disabled. Use 'safe_grep' instead." - -export function createGrepBlocker(_ctx: PluginInput) { - return { - "tool.execute.before": async ( - input: { tool: string; sessionID: string; callID: string }, - _output: { args: unknown } - ) => { - if (input.tool === "grep") { - throw new Error(BLOCKED_MESSAGE) - } - }, - } -}