From 66c8624d664e6bb1b51e6fede510e0220a0123aa Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Tue, 7 Apr 2026 08:02:22 +0000 Subject: [PATCH] fix: move set_debug_mode to kugetsu-config.sh The queue daemon crashes with 'set_debug_mode: command not found' because cmd_continue() calls set_debug_mode(), but that function was only defined in the main kugetsu script. Instead of duplicating the function, move it to kugetsu-config.sh which is always sourced before kugetsu-session.sh in all contexts. Fixes #207 --- skills/kugetsu/scripts/kugetsu-config.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/skills/kugetsu/scripts/kugetsu-config.sh b/skills/kugetsu/scripts/kugetsu-config.sh index 8b20235..3a033c0 100755 --- a/skills/kugetsu/scripts/kugetsu-config.sh +++ b/skills/kugetsu/scripts/kugetsu-config.sh @@ -64,3 +64,26 @@ load_agent_env() { set +a fi } + +set_debug_mode() { + local filtered_args=() + local debug_mode=false + + for arg in "$@"; do + case "$arg" in + --debug) + debug_mode=true + ;; + *) + filtered_args+=("$arg") + ;; + esac + done + + if [ "$debug_mode" = true ]; then + export KUGETSU_VERBOSITY="debug" + echo "[DEBUG] Debug mode enabled" >&2 + fi + + echo "${filtered_args[@]}" +}