From 1ecb2bafdf6e23652a587ae5e589508ae9702b9d Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Fri, 16 Jan 2026 14:01:29 +0900 Subject: [PATCH] fix(hooks): prevent start-work false trigger from command description - Remove 'Start Sisyphus work session' text check, keep only tag - Update interactive_bash description with WARNING: TMUX ONLY emphasis - Update tests to use wrapper --- src/hooks/start-work/index.test.ts | 42 +++++++++++-------------- src/hooks/start-work/index.ts | 6 ++-- src/tools/interactive-bash/constants.ts | 6 ++-- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/hooks/start-work/index.test.ts b/src/hooks/start-work/index.test.ts index 43908877..73c1f2a5 100644 --- a/src/hooks/start-work/index.test.ts +++ b/src/hooks/start-work/index.test.ts @@ -93,7 +93,7 @@ describe("start-work hook", () => { const hook = createStartWorkHook(createMockPluginInput()) const output = { - parts: [{ type: "text", text: "Start Sisyphus work session" }], + parts: [{ type: "text", text: "" }], } // #when @@ -114,7 +114,7 @@ describe("start-work hook", () => { parts: [ { type: "text", - text: "Start Sisyphus work session\nSession: $SESSION_ID", + text: "Session: $SESSION_ID", }, ], } @@ -137,7 +137,7 @@ describe("start-work hook", () => { parts: [ { type: "text", - text: "Start Sisyphus work session\nTime: $TIMESTAMP", + text: "Time: $TIMESTAMP", }, ], } @@ -168,7 +168,7 @@ describe("start-work hook", () => { const hook = createStartWorkHook(createMockPluginInput()) const output = { - parts: [{ type: "text", text: "Start Sisyphus work session" }], + parts: [{ type: "text", text: "" }], } // #when @@ -196,7 +196,7 @@ describe("start-work hook", () => { const hook = createStartWorkHook(createMockPluginInput()) const output = { - parts: [{ type: "text", text: "Start Sisyphus work session" }], + parts: [{ type: "text", text: "" }], } // #when @@ -224,7 +224,7 @@ describe("start-work hook", () => { const hook = createStartWorkHook(createMockPluginInput()) const output = { - parts: [{ type: "text", text: "Start Sisyphus work session" }], + parts: [{ type: "text", text: "" }], } // #when @@ -265,10 +265,9 @@ describe("start-work hook", () => { parts: [ { type: "text", - text: `Start Sisyphus work session - -new-plan -`, + text: ` +new-plan +`, }, ], } @@ -298,10 +297,9 @@ new-plan parts: [ { type: "text", - text: `Start Sisyphus work session - -my-feature-plan ultrawork -`, + text: ` +my-feature-plan ultrawork +`, }, ], } @@ -330,10 +328,9 @@ my-feature-plan ultrawork parts: [ { type: "text", - text: `Start Sisyphus work session - -api-refactor ulw -`, + text: ` +api-refactor ulw +`, }, ], } @@ -362,10 +359,9 @@ api-refactor ulw parts: [ { type: "text", - text: `Start Sisyphus work session - -feature-implementation -`, + text: ` +feature-implementation +`, }, ], } @@ -389,7 +385,7 @@ feature-implementation const hook = createStartWorkHook(createMockPluginInput()) const output = { - parts: [{ type: "text", text: "Start Sisyphus work session" }], + parts: [{ type: "text", text: "" }], } // #when - start-work command is processed diff --git a/src/hooks/start-work/index.ts b/src/hooks/start-work/index.ts index 9bd217d1..25df6b11 100644 --- a/src/hooks/start-work/index.ts +++ b/src/hooks/start-work/index.ts @@ -59,9 +59,9 @@ export function createStartWorkHook(ctx: PluginInput) { .join("\n") .trim() || "" - const isStartWorkCommand = - promptText.includes("Start Sisyphus work session") || - promptText.includes("") + // Only trigger on actual command execution (contains tag) + // NOT on description text like "Start Sisyphus work session from Prometheus plan" + const isStartWorkCommand = promptText.includes("") if (!isStartWorkCommand) { return diff --git a/src/tools/interactive-bash/constants.ts b/src/tools/interactive-bash/constants.ts index 485846f2..67570e4c 100644 --- a/src/tools/interactive-bash/constants.ts +++ b/src/tools/interactive-bash/constants.ts @@ -11,8 +11,8 @@ export const BLOCKED_TMUX_SUBCOMMANDS = [ "pipep", ] -export const INTERACTIVE_BASH_DESCRIPTION = `Execute tmux commands. Use "omo-{name}" session pattern. +export const INTERACTIVE_BASH_DESCRIPTION = `WARNING: This is TMUX ONLY. Pass tmux subcommands directly (without 'tmux' prefix). -For: server processes, long-running tasks, background jobs, interactive CLI tools. +Examples: new-session -d -s omo-dev, send-keys -t omo-dev "vim" Enter -Blocked (use bash instead): capture-pane, save-buffer, show-buffer, pipe-pane.` +For TUI apps needing ongoing interaction (vim, htop, pudb). One-shot commands → use Bash with &.`