fix(kugetsu): export KUGETSU_TEMP_DIR for subagent workflows #85

Closed
shoko wants to merge 1 commits from fix/issue-73-temp-dir-config into main
Owner

Summary

Fix for #73 - OpenCode /tmp/* Permission Blocking Subagent Workflows

Changes

  1. Add KUGETSU_TEMP_DIR to default config template (commented):

    • Default: ~/.local/share/opencode/tool-output
    • This directory is allowed by opencode unlike /tmp
  2. Export KUGETSU_TEMP_DIR in cmd_delegate:

    • Subagents receive KUGETSU_TEMP_DIR environment variable
    • Can use ${KUGETSU_TEMP_DIR:-/tmp} instead of raw /tmp

Usage

Agents should use:

# Instead of writing to /tmp
echo "data" > ${KUGETSU_TEMP_DIR:-/tmp}/file.txt

# curl with @file
curl -d @${KUGETSU_TEMP_DIR:-/tmp}/data.json https://api.example.com

Fixes #73

## Summary Fix for #73 - OpenCode /tmp/* Permission Blocking Subagent Workflows ## Changes 1. Add KUGETSU_TEMP_DIR to default config template (commented): - Default: `~/.local/share/opencode/tool-output` - This directory is allowed by opencode unlike /tmp 2. Export KUGETSU_TEMP_DIR in cmd_delegate: - Subagents receive KUGETSU_TEMP_DIR environment variable - Can use `${KUGETSU_TEMP_DIR:-/tmp}` instead of raw `/tmp` ## Usage Agents should use: ```bash # Instead of writing to /tmp echo "data" > ${KUGETSU_TEMP_DIR:-/tmp}/file.txt # curl with @file curl -d @${KUGETSU_TEMP_DIR:-/tmp}/data.json https://api.example.com ``` Fixes #73
shoko added 1 commit 2026-04-02 01:15:13 +02:00
- Add KUGETSU_TEMP_DIR to default config (commented, defaults to ~/.local/share/opencode/tool-output)
- Export KUGETSU_TEMP_DIR in cmd_delegate to subagent sessions
- This directory is allowed by opencode unlike /tmp which may be blocked

Fixes #73
shoko closed this pull request 2026-04-02 02:56:06 +02:00

Pull request closed

Sign in to join this conversation.