From bf6aea18bb2b94ddf0e7f095f29c987b421c1004 Mon Sep 17 00:00:00 2001 From: Akhilesh Arora Date: Sat, 16 May 2026 20:26:41 +0200 Subject: [PATCH] Fix mktemp template so deploy-managed-agent.sh runs on Linux GNU mktemp wants 3+ X's in a -t template. The bare `mktemp -t skillcache` and `mktemp -t skill` calls worked on macOS but crash on Linux before the script does anything. test-cookbooks.sh fails the same way for all 5 cookbooks because it calls deploy --dry-run. Adding .XXXXXX is portable: GNU expands the X's, BSD treats them as prefix. Confirmed on Ubuntu 24.04 / coreutils 9.4: test-cookbooks goes 0/5 -> 5/5. --- scripts/deploy-managed-agent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-managed-agent.sh b/scripts/deploy-managed-agent.sh index b6966f1..816f65b 100755 --- a/scripts/deploy-managed-agent.sh +++ b/scripts/deploy-managed-agent.sh @@ -64,7 +64,7 @@ json.dump(yaml.safe_load(t), sys.stdout) ' "$1" } -SKILL_CACHE_FILE="$(mktemp -t skillcache)" +SKILL_CACHE_FILE="$(mktemp -t skillcache.XXXXXX)" trap 'rm -f "$SKILL_CACHE_FILE"' EXIT upload_skill() { local path="$1" key cached @@ -77,7 +77,7 @@ upload_skill() { printf '%s' "$cached"; return fi local resp id zip - zip="$(mktemp -t skill).zip" + zip="$(mktemp -t skill.XXXXXX).zip" (cd "$(dirname "$path")" && zip -qr "$zip" "$(basename "$path")") # /v1/skills uses its own beta header and multipart, not the managed-agents JSON path resp=$(curl -sS "$API/v1/skills" \