+func TestPromptHasTheLinesOnSubagents(t *testing.T) {
+ text := prompt("Ada", "")
+ require.Contains(t, text, "Do the user's tasks yourself, with your tools.\nUse subagents only when the user asks for them.\n")
+ require.Contains(t, text, `Messages the user sends while you work reach you between tool calls.
+Subagents run in the background; each one's report reaches you as a message
+starting "[Name]", between your tool calls or as a new turn. Never wait for one
+(no sleep, no polling): go on, or end your turn and tell the user what is
+running.
+`)
+}
+
+func TestSubagentPromptNamesTheAgentAndEndsWithTheInstructions(t *testing.T) {
+ text := promptSubagent("Ada", "\nI am Lena.\n")
+ require.True(t, strings.HasPrefix(text, "You are a subagent of Ada, an AI agent"))
+ require.Contains(t, text, "Ada gave you a task. Do it yourself, with your tools,\nfollowing the user's instructions at the end of this prompt: they say who the\nuser is, how their files are organized and how they want work done.\n")
+ require.Contains(t, text, "zoom(\"Name\") gives an agent's\nwhole chat.")
+ require.True(t, strings.HasSuffix(text, "\n\n# The user's instructions\n\nI am Lena."))
+ require.NotContains(t, text, promptName)
+
+ for _, absent := range []string{"image", "computer", "device", "Compaction"} {
+ require.NotContains(t, text, absent)
+ }
+
+ text = promptSubagent("Ada", " \n")
+ require.Contains(t, text, "Ada gave you a task. Do it yourself, with your tools.\n")
+ require.NotContains(t, text, "instructions")
+}
+