From 1bdb64383cbfa90739fd1389a7469eb733c7821b Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 01:01:37 +0000 Subject: [PATCH 1/3] 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. Also includes KUGETSU_TEMP_DIR export from #92 fix. Fixes #46 --- skills/kugetsu/scripts/kugetsu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skills/kugetsu/scripts/kugetsu b/skills/kugetsu/scripts/kugetsu index 29348bc..354bfdd 100755 --- a/skills/kugetsu/scripts/kugetsu +++ b/skills/kugetsu/scripts/kugetsu @@ -10,6 +10,7 @@ NOTIFICATIONS_FILE="$KUGETSU_DIR/notifications.json" LOGS_DIR="$KUGETSU_DIR/logs" ENV_DIR="${ENV_DIR:-$KUGETSU_DIR/env}" MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}" +KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-total}" # Load user config overrides (~/.kugetsu/config) if [ -f "$KUGETSU_DIR/config" ]; then @@ -547,6 +548,7 @@ cmd_status() { cmd_delegate() { local message="${1:-}" + local verbosity="${KUGETSU_VERBOSITY:-total}" if [ -z "$message" ]; then echo "Error: message is required" >&2 @@ -563,8 +565,10 @@ cmd_delegate() { mkdir -p "$LOGS_DIR" local log_file="$LOGS_DIR/delegate-$(date +%s).log" + local temp_dir="${KUGETSU_TEMP_DIR:-$HOME/.local/share/opencode/tool-output}" + mkdir -p "$ENV_DIR" - local env_sh="set -a; " + local env_sh="set -a; export KUGETSU_TEMP_DIR='$temp_dir'; export KUGETSU_VERBOSITY='$verbosity'; " 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 @@ -575,6 +579,7 @@ cmd_delegate() { 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() { -- 2.49.1 From 534cd95993a96d3b9dece814e6c17ecb4040eef3 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 01:47:56 +0000 Subject: [PATCH 2/3] feat(kugetsu): add verbosity markdown context approach - Add VERBOSITY_DIR constant - Add get_verbosity_context() and init_verbosity_templates() functions - Create verbosity markdown files: total.md, medium.md, minimal.md - Change default verbosity from 'total' to 'normal' --- skills/kugetsu/scripts/kugetsu | 66 +++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/skills/kugetsu/scripts/kugetsu b/skills/kugetsu/scripts/kugetsu index 354bfdd..5bc0b91 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" ENV_DIR="${ENV_DIR:-$KUGETSU_DIR/env}" +VERBOSITY_DIR="$KUGETSU_DIR/verbosity" MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}" KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-total}" @@ -546,6 +547,62 @@ cmd_status() { echo "ok" } +get_verbosity_context() { + local verbosity="${KUGETSU_VERBOSITY:-total}" + local verbosity_file="$VERBOSITY_DIR/${verbosity}.md" + + if [ -f "$verbosity_file" ]; then + cat "$verbosity_file" + else + echo "## Verbosity: $verbosity" + echo "Verbosity level: $verbosity" + fi +} + +init_verbosity_templates() { + mkdir -p "$VERBOSITY_DIR" + + if [ ! -f "$VERBOSITY_DIR/total.md" ]; then + cat > "$VERBOSITY_DIR/total.md" << 'EOF' +## Verbosity: Total + +You are operating in HIGH verbosity mode. Include ALL available context: +- Full command outputs and their results +- Detailed reasoning and thinking process +- All file changes with diffs when relevant +- Complete log excerpts +- Comprehensive status updates +- Ask clarifying questions when uncertain +EOF + fi + + if [ ! -f "$VERBOSITY_DIR/medium.md" ]; then + cat > "$VERBOSITY_DIR/medium.md" << 'EOF' +## Verbosity: Medium + +You are operating in MEDIUM verbosity mode. Provide balanced output: +- Standard command outputs and key results +- Moderate reasoning detail +- Important file changes summarized +- Relevant log excerpts (not full) +- Regular status updates +EOF + fi + + if [ ! -f "$VERBOSITY_DIR/quiet.md" ]; then + cat > "$VERBOSITY_DIR/quiet.md" << 'EOF' +## Verbosity: Quiet + +You are operating in QUIET/MINIMAL verbosity mode. Keep output minimal: +- Only essential information +- Brief status updates (1-2 sentences) +- Final decisions only +- Yes/No answers when appropriate +- Skip detailed explanations unless requested +EOF + fi +} + cmd_delegate() { local message="${1:-}" local verbosity="${KUGETSU_VERBOSITY:-total}" @@ -568,6 +625,13 @@ cmd_delegate() { local temp_dir="${KUGETSU_TEMP_DIR:-$HOME/.local/share/opencode/tool-output}" mkdir -p "$ENV_DIR" + init_verbosity_templates + + local verbosity_context=$(get_verbosity_context) + local full_message="${verbosity_context} + +${message}" + local env_sh="set -a; export KUGETSU_TEMP_DIR='$temp_dir'; export KUGETSU_VERBOSITY='$verbosity'; " if [ -f "$ENV_DIR/pm-agent.env" ]; then env_sh="${env_sh}source '$ENV_DIR/pm-agent.env'; " @@ -576,7 +640,7 @@ cmd_delegate() { fi env_sh="${env_sh}set +a; " - nohup sh -c "${env_sh}opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 & + nohup sh -c "${env_sh}opencode run '$full_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" -- 2.49.1 From a96a48a7ee3a784a7e9c5d67af390ee24e9a4e23 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 02:08:16 +0000 Subject: [PATCH 3/3] feat(kugetsu): rename verbosity levels to verbose/default/quiet - Rename KUGETSU_VERBOSITY default from 'total' to 'default' - Rename total.md -> verbose.md - Rename medium.md -> default.md - Keep minimal.md but update to quiet.md naming - Update init_verbosity_templates to create verbose.md, default.md, quiet.md --- skills/kugetsu/scripts/kugetsu | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/skills/kugetsu/scripts/kugetsu b/skills/kugetsu/scripts/kugetsu index 5bc0b91..1caec9c 100755 --- a/skills/kugetsu/scripts/kugetsu +++ b/skills/kugetsu/scripts/kugetsu @@ -11,7 +11,7 @@ LOGS_DIR="$KUGETSU_DIR/logs" ENV_DIR="${ENV_DIR:-$KUGETSU_DIR/env}" VERBOSITY_DIR="$KUGETSU_DIR/verbosity" MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}" -KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-total}" +KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-default}" # Load user config overrides (~/.kugetsu/config) if [ -f "$KUGETSU_DIR/config" ]; then @@ -548,23 +548,22 @@ cmd_status() { } get_verbosity_context() { - local verbosity="${KUGETSU_VERBOSITY:-total}" + local verbosity="${KUGETSU_VERBOSITY:-default}" local verbosity_file="$VERBOSITY_DIR/${verbosity}.md" if [ -f "$verbosity_file" ]; then cat "$verbosity_file" else echo "## Verbosity: $verbosity" - echo "Verbosity level: $verbosity" fi } init_verbosity_templates() { mkdir -p "$VERBOSITY_DIR" - if [ ! -f "$VERBOSITY_DIR/total.md" ]; then - cat > "$VERBOSITY_DIR/total.md" << 'EOF' -## Verbosity: Total + if [ ! -f "$VERBOSITY_DIR/verbose.md" ]; then + cat > "$VERBOSITY_DIR/verbose.md" << 'EOF' +## Verbosity: Verbose You are operating in HIGH verbosity mode. Include ALL available context: - Full command outputs and their results @@ -576,15 +575,14 @@ You are operating in HIGH verbosity mode. Include ALL available context: EOF fi - if [ ! -f "$VERBOSITY_DIR/medium.md" ]; then - cat > "$VERBOSITY_DIR/medium.md" << 'EOF' -## Verbosity: Medium + if [ ! -f "$VERBOSITY_DIR/default.md" ]; then + cat > "$VERBOSITY_DIR/default.md" << 'EOF' +## Verbosity: Default -You are operating in MEDIUM verbosity mode. Provide balanced output: +You are operating in NORMAL verbosity mode. Provide balanced output: - Standard command outputs and key results - Moderate reasoning detail - Important file changes summarized -- Relevant log excerpts (not full) - Regular status updates EOF fi @@ -593,19 +591,18 @@ EOF cat > "$VERBOSITY_DIR/quiet.md" << 'EOF' ## Verbosity: Quiet -You are operating in QUIET/MINIMAL verbosity mode. Keep output minimal: +You are operating in QUIET verbosity mode. Keep output minimal: - Only essential information - Brief status updates (1-2 sentences) - Final decisions only - Yes/No answers when appropriate -- Skip detailed explanations unless requested EOF fi } cmd_delegate() { local message="${1:-}" - local verbosity="${KUGETSU_VERBOSITY:-total}" + local verbosity="${KUGETSU_VERBOSITY:-default}" if [ -z "$message" ]; then echo "Error: message is required" >&2 -- 2.49.1