X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/723f6e18adc6482ed913e1618c8a76e981720c2b..195c3fbb075383ac47bba310eb701b02774e8d10:/prompt_test.go?ds=inline diff --git a/prompt_test.go b/prompt_test.go index c9cadc2..888057f 100644 --- a/prompt_test.go +++ b/prompt_test.go @@ -18,6 +18,7 @@ func TestPromptNamesTheAgent(t *testing.T) { require.Contains(t, text, `- work: an agent's report, starting "[Name]"`) require.Contains(t, text, "- zoom(id, 1) gives message id whole\n- zoom(\"Name\") gives an agent's whole chat\n") require.NotContains(t, text, promptName) + require.Contains(t, text, "[image FILE]") // The old agent name is built from parts, so the source does not spell // it. @@ -26,7 +27,7 @@ func TestPromptNamesTheAgent(t *testing.T) { func TestPromptLeavesOutAbsentFeatures(t *testing.T) { text := prompt("Ada", "/AGENT/instructions.md", "") - for _, absent := range []string{"image", "computer", "device", "instructions at the end"} { + for _, absent := range []string{"computer", "device", "instructions at the end"} { require.NotContains(t, text, absent) } } @@ -50,7 +51,7 @@ func TestSubagentPromptNamesTheAgentAndEndsWithTheInstructions(t *testing.T) { 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"} { + for _, absent := range []string{"computer", "device", "Compaction"} { require.NotContains(t, text, absent) } @@ -128,7 +129,7 @@ func TestProbePromptKeepsTheInstructionsPathStable(t *testing.T) { func TestAgentToolsAreStrictAndStable(t *testing.T) { tools := promptTools() - require.Equal(t, []string{"zoom", "date", "shell", "read", "write", "edit", "spawn", "agent_create", "tell", "whatsapp_find", "whatsapp_send", "route", "unroute", "routes", "schedule_set", "schedule_list", "schedule_remove"}, promptToolNames(tools)) + require.Equal(t, []string{"zoom", "date", "shell", "read", "write", "edit", "spawn", "agent_create", "tell", "image_show", "whatsapp_find", "whatsapp_send", "route", "unroute", "routes", "schedule_set", "schedule_list", "schedule_remove"}, promptToolNames(tools)) require.Equal(t, []string{"zoom", "date", "shell", "read", "write", "edit"}, promptToolNames(promptSubagentTools())) for _, tool := range tools { @@ -165,3 +166,14 @@ func TestRootPromptDefinesChildRoutingAndConsent(t *testing.T) { require.NotContains(t, child, "Use agent_create") require.Contains(t, child, "Send nothing to WhatsApp. Draft replies in your report instead") } + +func TestRootPromptKeepsImageConsentAndChildForwardingRules(t *testing.T) { + text := prompt("Ada", "/AGENT/instructions.md", "") + require.Contains(t, text, "Use image_show or whatsapp_send with an image only on the user's request.") + require.Contains(t, text, "Pass an image to a child with an [image FILE] line in tell.") + + child := promptChild("House", "Ada", "Keep house plans.", "/CHILD/instructions.md", "") + require.Contains(t, child, "Send nothing to WhatsApp. Draft replies in your report instead") + require.NotContains(t, promptToolNames(promptSubagentTools()), "image_show") + require.NotContains(t, promptToolNames(promptSubagentTools()), "whatsapp_send") +}