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}")