From 36eeb38a067d8fc9f7d7055492880e97ba88f024 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 17 May 2026 13:59:59 +0200 Subject: [PATCH] subagent_spawn: only cleanup jit-* configs; fix Returns doc --- prompts/tools-subagent.md | 2 +- tools/subagent_spawn | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/prompts/tools-subagent.md b/prompts/tools-subagent.md index 0898ab3..c081386 100644 --- a/prompts/tools-subagent.md +++ b/prompts/tools-subagent.md @@ -24,7 +24,7 @@ pipe: stages=[ ] ``` -**Returns**: `subagent_generate` returns the agent config name. `subagent_spawn` returns the session path (e.g. `s/my-session`). +**Returns**: `subagent_generate` returns the agent config name. `subagent_spawn` returns structured KV: `session`, `path`, `backend`, `model`. ## subagent_generate diff --git a/tools/subagent_spawn b/tools/subagent_spawn index 6a3fe94..df78426 100755 --- a/tools/subagent_spawn +++ b/tools/subagent_spawn @@ -73,7 +73,8 @@ done printf '%s\n' "$prompt" > "$B/prompt" || die "failed to submit prompt" # Clean up JIT agent config now that the server has loaded it. -[ -n "$agent" ] && rm -f "$OLLIE/a/${agent}.json" 2>/dev/null || true +# Only remove configs with the jit- prefix (generated by subagent_generate). +[[ "${agent:-}" == jit-* ]] && rm -f "$OLLIE/a/${agent}.json" 2>/dev/null || true # Report resolved values from the live session. resolved_backend=$(grep -m1 '^backend=' "$B/cfg" 2>/dev/null | cut -d= -f2- || echo "${backend:-default}")