diff --git a/skills/kugetsu/scripts/kugetsu-session.sh b/skills/kugetsu/scripts/kugetsu-session.sh index 8b49d84..e1a7b9f 100755 --- a/skills/kugetsu/scripts/kugetsu-session.sh +++ b/skills/kugetsu/scripts/kugetsu-session.sh @@ -225,7 +225,10 @@ cmd_delegate() { exit 1 fi - nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --session '$new_session'" >> "$log_file" 2>&1 & + local msg_file="$LOGS_DIR/msg-$new_session.txt" + printf '%s' "$message" > "$msg_file" + nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session'" >> "$log_file" 2>&1 & + rm -f "$msg_file" echo "Delegated to new session (logged to $(basename "$log_file"))" } @@ -373,7 +376,10 @@ cmd_start() { load_agent_env "dev" cd "$worktree_path" - nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$dev_message' --session '$new_session_id'" >> "$LOGS_DIR/dev-$new_session_id.log" 2>&1 & + local msg_file="$LOGS_DIR/msg-$new_session_id.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-$new_session_id.log" 2>&1 & + rm -f "$msg_file" echo "Session started for '$issue_ref': $new_session_id" echo "Worktree: $worktree_path" @@ -436,7 +442,10 @@ cmd_continue() { fi cd "$worktree_path" - nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$opencode_session_id.log" 2>&1 & + local msg_file="$LOGS_DIR/msg-$opencode_session_id.txt" + printf '%s' "$message" > "$msg_file" + nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$opencode_session_id.log" 2>&1 & + rm -f "$msg_file" } cmd_list() {