feat(hook): block grep tool and guide to safe-grep

This commit is contained in:
YeonGyu-Kim
2025-12-04 18:06:29 +09:00
parent 8c6dc77d53
commit b397dd6655
2 changed files with 13 additions and 7 deletions

View File

@@ -96,6 +96,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
},
"tool.execute.before": async (input, _output) => {
if (input.tool === "grep") {
throw new Error(`[BLOCKED] grep has no timeout and can freeze the system. It is permanently disabled. Use 'safe-grep' instead.`)
}
if (input.sessionID === mainSessionID) {
updateTerminalTitle({
sessionId: input.sessionID,