feat(kugetsu): add KUGETSU_VERBOSITY for PM agent output control

This commit is contained in:
shokollm
2026-04-02 03:31:47 +00:00
parent caf1e9cdcd
commit 5c9c791142

View File

@@ -10,6 +10,7 @@ NOTIFICATIONS_FILE="$KUGETSU_DIR/notifications.json"
LOGS_DIR="$KUGETSU_DIR/logs" LOGS_DIR="$KUGETSU_DIR/logs"
ENV_DIR="${ENV_DIR:-$KUGETSU_DIR/env}" ENV_DIR="${ENV_DIR:-$KUGETSU_DIR/env}"
MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}" MAX_CONCURRENT_AGENTS="${MAX_CONCURRENT_AGENTS:-3}"
KUGETSU_VERBOSITY="${KUGETSU_VERBOSITY:-total}"
# Load user config overrides (~/.kugetsu/config) # Load user config overrides (~/.kugetsu/config)
if [ -f "$KUGETSU_DIR/config" ]; then if [ -f "$KUGETSU_DIR/config" ]; then
@@ -547,6 +548,7 @@ cmd_status() {
cmd_delegate() { cmd_delegate() {
local message="${1:-}" local message="${1:-}"
local verbosity="${KUGETSU_VERBOSITY:-total}"
if [ -z "$message" ]; then if [ -z "$message" ]; then
echo "Error: message is required" >&2 echo "Error: message is required" >&2
@@ -566,7 +568,7 @@ cmd_delegate() {
local temp_dir="${KUGETSU_TEMP_DIR:-$HOME/.local/share/opencode/tool-output}" local temp_dir="${KUGETSU_TEMP_DIR:-$HOME/.local/share/opencode/tool-output}"
mkdir -p "$ENV_DIR" mkdir -p "$ENV_DIR"
local env_sh="set -a; export KUGETSU_TEMP_DIR='$temp_dir'; " local env_sh="set -a; export KUGETSU_TEMP_DIR='$temp_dir'; export KUGETSU_VERBOSITY='$verbosity'; "
if [ -f "$ENV_DIR/pm-agent.env" ]; then if [ -f "$ENV_DIR/pm-agent.env" ]; then
env_sh="${env_sh}source '$ENV_DIR/pm-agent.env'; " env_sh="${env_sh}source '$ENV_DIR/pm-agent.env'; "
elif [ -f "$ENV_DIR/default.env" ]; then elif [ -f "$ENV_DIR/default.env" ]; then
@@ -577,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 & nohup sh -c "${env_sh}opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 &
disown disown
echo "Delegated to PM agent (logged to $(basename "$log_file"))" echo "Delegated to PM agent (logged to $(basename "$log_file"))"
echo "Verbosity: $verbosity"
} }
cmd_logs() { cmd_logs() {