fix(session): run delegate synchronously when no issue ref is provided

When kugetsu delegate is called without an issue ref, it now runs
interactively and synchronously instead of fire-and-forget with nohup.

This allows users to see PM response immediately for guidance/creation
requests rather than having the interaction run in background.
This commit is contained in:
shokollm
2026-04-08 10:36:49 +00:00
parent 920d714c8f
commit 2aa6785f75

View File

@@ -228,8 +228,7 @@ cmd_delegate() {
local msg_file="$LOGS_DIR/msg-$new_session.txt" local msg_file="$LOGS_DIR/msg-$new_session.txt"
printf '%s' "$message" > "$msg_file" printf '%s' "$message" > "$msg_file"
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session'" >> "$log_file" 2>&1 & sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session'" 2>&1 | tee "$log_file"
echo "Delegated to new session (logged to $(basename "$log_file"))"
} }
create_session() { create_session() {