From 1594204a787f5bf2da4bee90f2da35fc9aaa933c Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:21:36 +0000 Subject: [PATCH] feat(kugetsu): add KUGETSU_VERBOSITY for PM agent output control Add KUGETSU_VERBOSITY environment variable with three modes: - total (default): Work silently, post only final summary - verbose: Post every action (current noisy behavior) - hybrid: Post only on errors Export KUGETSU_VERBOSITY in cmd_delegate so PM agent can read it. Add config option to cmd_init template. Fixes #46 --- skills/kugetsu/scripts/kugetsu | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/skills/kugetsu/scripts/kugetsu b/skills/kugetsu/scripts/kugetsu index 24152c1..fafcdca 100755 --- a/skills/kugetsu/scripts/kugetsu +++ b/skills/kugetsu/scripts/kugetsu @@ -9,6 +9,7 @@ INDEX_FILE="$KUGETSU_DIR/index.json" NOTIFICATIONS_FILE="$KUGETSU_DIR/notifications.json" LOGS_DIR="$KUGETSU_DIR/logs" MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}" +KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-total}" # Load user config overrides (~/.kugetsu/config) if [ -f "$KUGETSU_DIR/config" ]; then @@ -508,6 +509,7 @@ cmd_status() { cmd_delegate() { local message="${1:-}" + local verbosity="${KUGETSU_VERBOSITY:-total}" if [ -z "$message" ]; then echo "Error: message is required" >&2 @@ -523,9 +525,23 @@ cmd_delegate() { mkdir -p "$LOGS_DIR" local log_file="$LOGS_DIR/delegate-$(date +%s).log" - nohup sh -c "opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 & + + local temp_dir="${KUGETSU_TEMP_DIR:-$HOME/.local/share/opencode/tool-output}" + local env_sh="export KUGETSU_VERBOSITY='$verbosity'; export KUGETSU_TEMP_DIR='$temp_dir'; " + + if [ -f "$ENV_DIR/pm-agent.env" ]; then + env_sh="${env_sh}source '$ENV_DIR/pm-agent.env'; " + elif [ -f "$ENV_DIR/default.env" ]; then + env_sh="${env_sh}source '$ENV_DIR/default.env'; " + fi + if [ -n "${GITEA_TOKEN:-}" ]; then + env_sh="${env_sh}export GITEA_TOKEN='$GITEA_TOKEN'; " + fi + + nohup sh -c "${env_sh}opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 & disown echo "Delegated to PM agent (logged to $(basename "$log_file"))" + echo "Verbosity: $verbosity" } cmd_logs() { @@ -694,6 +710,12 @@ cmd_init() { # Max concurrent dev agents (default: 3) # MAX_CONCURRENT_AGENTS=5 + +# PM Agent verbosity: total, verbose, or hybrid (default: total) +# total - Work silently, post only final summary +# verbose - Post every action (noisy) +# hybrid - Post only on errors +# KUGETSU_VERBOSITY=total EOF echo "Created config file: $KUGETSU_DIR/config" fi -- 2.49.1