Compare commits

...

2 Commits

Author SHA1 Message Date
shokollm
66c8624d66 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
2026-04-07 08:31:17 +00:00
2beb3adb14 fix: remove unnecessary rm of msg file to avoid race condition (#200) 2026-04-07 05:29:07 +02:00
2 changed files with 23 additions and 2 deletions

View File

@@ -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[@]}"
}

View File

@@ -382,7 +382,6 @@ cmd_start() {
local msg_file="$worktree_path/.kugetsu-msg.txt"
printf '%s' "$dev_message" > "$msg_file"
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 &
rm -f "$msg_file"
echo "Session started for '$issue_ref': $new_session_id"
echo "Worktree: $worktree_path"
@@ -449,7 +448,6 @@ cmd_continue() {
local msg_file="$worktree_path/.kugetsu-msg.txt"
printf '%s' "$message" > "$msg_file"
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 &
rm -f "$msg_file"
}
cmd_list() {