From 2bf11a8ed7431e76001595e58acb82e969db6866 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 10 Feb 2026 17:13:31 +0900 Subject: [PATCH] feat(prometheus): allow bash commands for Prometheus agent Remove bash tool restriction from prometheus-md-only hook. Prometheus can now execute bash commands for better plan generation context. --- src/hooks/prometheus-md-only/constants.ts | 2 +- src/hooks/prometheus-md-only/hook.ts | 14 -------------- src/hooks/prometheus-md-only/index.test.ts | 4 ++-- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/hooks/prometheus-md-only/constants.ts b/src/hooks/prometheus-md-only/constants.ts index 447975a2..9b54e698 100644 --- a/src/hooks/prometheus-md-only/constants.ts +++ b/src/hooks/prometheus-md-only/constants.ts @@ -9,7 +9,7 @@ export const ALLOWED_EXTENSIONS = [".md"] export const ALLOWED_PATH_PREFIX = ".sisyphus" -export const BLOCKED_TOOLS = ["Write", "Edit", "write", "edit", "bash"] +export const BLOCKED_TOOLS = ["Write", "Edit", "write", "edit"] export const PLANNING_CONSULT_WARNING = ` diff --git a/src/hooks/prometheus-md-only/hook.ts b/src/hooks/prometheus-md-only/hook.ts index e44549c2..d693836c 100644 --- a/src/hooks/prometheus-md-only/hook.ts +++ b/src/hooks/prometheus-md-only/hook.ts @@ -40,20 +40,6 @@ export function createPrometheusMdOnlyHook(ctx: PluginInput) { return } - // Block bash commands completely - Prometheus is read-only - if (toolName === "bash") { - log(`[${HOOK_NAME}] Blocked: Prometheus cannot execute bash commands`, { - sessionID: input.sessionID, - tool: toolName, - agent: agentName, - }) - throw new Error( - `[${HOOK_NAME}] ${getAgentDisplayName("prometheus")} cannot execute bash commands. ` + - `${getAgentDisplayName("prometheus")} is a READ-ONLY planner. Use /start-work to execute the plan. ` + - `APOLOGIZE TO THE USER, REMIND OF YOUR PLAN WRITING PROCESSES, TELL USER WHAT YOU WILL GOING TO DO AS THE PROCESS, WRITE THE PLAN` - ) - } - const filePath = (output.args.filePath ?? output.args.path ?? output.args.file) as string | undefined if (!filePath) { return diff --git a/src/hooks/prometheus-md-only/index.test.ts b/src/hooks/prometheus-md-only/index.test.ts index e576eecf..ca9cd32f 100644 --- a/src/hooks/prometheus-md-only/index.test.ts +++ b/src/hooks/prometheus-md-only/index.test.ts @@ -173,7 +173,7 @@ describe("prometheus-md-only", () => { ).rejects.toThrow("can only write/edit .md files") }) - test("should block bash commands from Prometheus", async () => { + test("should allow bash commands from Prometheus", async () => { // given const hook = createPrometheusMdOnlyHook(createMockPluginInput()) const input = { @@ -188,7 +188,7 @@ describe("prometheus-md-only", () => { // when / #then await expect( hook["tool.execute.before"](input, output) - ).rejects.toThrow("cannot execute bash commands") + ).resolves.toBeUndefined() }) test("should not affect non-blocked tools", async () => {