From e184b1e5b06317764d828c793f7876ebc2d4799a Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:55:41 +0000 Subject: [PATCH] fix(kugetsu): export KUGETSU_TEMP_DIR for subagent workflows Export KUGETSU_TEMP_DIR in cmd_delegate so subagents can use it instead of /tmp which may be blocked by opencode. Default: ~/.local/share/opencode/tool-output This allows agents to write temp files in an allowed directory instead of /tmp which is blocked in headless mode. Fixes #73 --- skills/kugetsu/scripts/kugetsu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skills/kugetsu/scripts/kugetsu b/skills/kugetsu/scripts/kugetsu index 29348bc..3b77ea0 100755 --- a/skills/kugetsu/scripts/kugetsu +++ b/skills/kugetsu/scripts/kugetsu @@ -563,8 +563,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'; " 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