diff --git a/navi/profiles/navi_code/system_prompt.txt b/navi/profiles/navi_code/system_prompt.txt index edd45f0..5c052de 100644 --- a/navi/profiles/navi_code/system_prompt.txt +++ b/navi/profiles/navi_code/system_prompt.txt @@ -33,7 +33,7 @@ - How to test/verify the result. - Write the context the sub-agent needs (files, snippets, how to verify) into the `context_transfer` scratchpad section before spawning — it's injected into the sub-agent automatically. The sub-agent does NOT inherit your short-term memory or conversation history. - The sub-agent's toolset is restricted: it has `todo`, `scratchpad`, `reflect`, `filesystem`, `code_exec`, `terminal`, `list_tools` — but NOT `memory`, `switch_profile`, `spawn_agent`, or `schedule_recall`/`manage_recall`. Brief it to use only what it has (e.g. record findings in `scratchpad`, not `memory`). -- Set `profile_id` to choose the sub-agent's profile, prompt, model, and tools (e.g. `developer` for general code work, `secretary` for research). Omit it only if the sub-agent should run as `navi_code` itself — it then inherits this profile, not a different one. +- For code work, OMIT `profile_id` so the sub-agent runs as `navi_code` (same profile, model, and tools as you) — that is the default and the correct choice for local coding. Set `profile_id` only when a step needs a different specialisation: `secretary` for research/writing, `server_admin` for remote ops, `tool_developer` for building Navi MCP tools. Do NOT set `profile_id="developer"` for code work — `navi_code` already covers it. - End with: "Complete all assigned work. Return: summary of changes, test output." --- diff --git a/navi/tools/spawn_agent.py b/navi/tools/spawn_agent.py index 6e00f07..f7c9b30 100644 --- a/navi/tools/spawn_agent.py +++ b/navi/tools/spawn_agent.py @@ -27,13 +27,15 @@ "USER CANNOT SEE sub-agent output — synthesise findings into your own response.\n\n" "USE when a step requires 3+ tool calls to complete as a single logical unit. " "DO NOT USE for a single tool call — call the tool directly.\n\n" - "PROFILE SELECTION: if your plan says to use a specific profile (e.g. 'server_admin' for remote ops, " - "'developer' for coding, 'secretary' for research), you MUST pass that exact profile_id in the JSON. " - "Only omit profile_id when the plan does NOT specify a profile — then the parent session's current profile is used.\n\n" + "PROFILE SELECTION: omit profile_id by default — the sub-agent then runs as the current " + "session's profile (e.g. navi_code for local coding), which is the right choice for most " + "code work. Set profile_id only to specialise: 'server_admin' for remote ops, 'secretary' " + "for research/writing, 'tool_developer' for Navi tool implementation. If your plan named a " + "specific profile, pass that exact profile_id.\n\n" "Examples (copy this structure exactly):\n" ' {\"task\": \"...\", \"profile_id\": \"server_admin\", \"briefing\": \"...\"}\n' - ' {\"task\": \"...\", \"profile_id\": \"developer\"}\n' - ' {\"task\": \"...\"} ← only when plan does not specify a profile\n\n' + ' {\"task\": \"...\", \"profile_id\": \"tool_developer\"}\n' + ' {\"task\": \"...\"} ← omit profile_id to run as the current session\'s profile\n\n' ) parameters = { "type": "object", @@ -57,10 +59,10 @@ "type": "string", "description": ( "Profile to use for the sub-agent. Defaults to the current session's " - "profile. Override to specialise: e.g. 'server_admin' for remote ops, " - "'secretary' for research, 'developer' for code work, " - "'tool_developer' for Navi tool implementation. The selected profile " - "determines the sub-agent's model, prompt, and available tools." + "profile (e.g. navi_code for local coding) — for plain code work, omit it. " + "Override to specialise: 'server_admin' for remote ops, 'secretary' for " + "research/writing, 'tool_developer' for Navi tool implementation. The " + "selected profile determines the sub-agent's model, prompt, and available tools." ), }, "system_prompt": {