Merge pull request 'fix(kugetsu): export KUGETSU_TEMP_DIR for subagent workflows' (#92) from fix/issue-73-temp-dir-v2 into main
This commit was merged in pull request #92.
This commit is contained in:
@@ -47,6 +47,7 @@ A default config file is created during `kugetsu init` with commented examples:
|
|||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|----------|---------|-------------|
|
|----------|---------|-------------|
|
||||||
| `MAX_CONCURRENT_AGENTS` | 3 | Maximum number of concurrent dev agents |
|
| `MAX_CONCURRENT_AGENTS` | 3 | Maximum number of concurrent dev agents |
|
||||||
|
| `KUGETSU_TEMP_DIR` | `~/.local/share/opencode/tool-output` | Temp directory for subagent tool output (useful in headless environments where /tmp is restricted) |
|
||||||
|
|
||||||
### Environment Variables for Agents
|
### Environment Variables for Agents
|
||||||
|
|
||||||
|
|||||||
@@ -563,8 +563,10 @@ cmd_delegate() {
|
|||||||
mkdir -p "$LOGS_DIR"
|
mkdir -p "$LOGS_DIR"
|
||||||
local log_file="$LOGS_DIR/delegate-$(date +%s).log"
|
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"
|
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
|
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
|
||||||
|
|||||||
@@ -634,6 +634,15 @@ else
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Test E7: KUGETSU_TEMP_DIR is exported in cmd_delegate
|
||||||
|
echo "--- Test: KUGETSU_TEMP_DIR export in cmd_delegate ---"
|
||||||
|
if grep -q "KUGETSU_TEMP_DIR" "$KUGETSU" && grep -q "export KUGETSU_TEMP_DIR" "$KUGETSU"; then
|
||||||
|
pass "KUGETSU_TEMP_DIR is exported to delegated agents"
|
||||||
|
else
|
||||||
|
fail "KUGETSU_TEMP_DIR not found in cmd_delegate export"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
# Cleanup env files
|
# Cleanup env files
|
||||||
rm -rf ~/.kugetsu/env 2>/dev/null || true
|
rm -rf ~/.kugetsu/env 2>/dev/null || true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user