diff --git a/prompts/tools-subagent.md b/prompts/tools-subagent.md index a2d018d..0898ab3 100644 --- a/prompts/tools-subagent.md +++ b/prompts/tools-subagent.md @@ -86,7 +86,6 @@ Remaining args: the task prompt (immediate task only — coordination lives in t - Subagents do not share memory. Pass context explicitly in the seed prompt. - Peers are known at spawn time. Assign `-name` to each and include the full roster in each identity. - Names must be globally unique under `s/`. Duplicate names fail silently. -- Clean up when done: `rm $OLLIE/a/.json` ## Returning results to the parent diff --git a/tools/subagent_spawn b/tools/subagent_spawn index 574504f..6a3fe94 100755 --- a/tools/subagent_spawn +++ b/tools/subagent_spawn @@ -71,4 +71,11 @@ done [ -d "$B" ] || die "timeout waiting for session $name" printf '%s\n' "$prompt" > "$B/prompt" || die "failed to submit prompt" -printf 'session=%s\npath=%s\nbackend=%s\nmodel=%s\n' "$name" "$B" "${backend:-default}" "${model:-default}" + +# Clean up JIT agent config now that the server has loaded it. +[ -n "$agent" ] && 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}") +resolved_model=$(grep -m1 '^model=' "$B/cfg" 2>/dev/null | cut -d= -f2- || echo "${model:-default}") +printf 'session=%s\npath=%s\nbackend=%s\nmodel=%s\n' "$name" "$B" "$resolved_backend" "$resolved_model"