]> git.giacomolli.uk - onechat/blobdiff - prompt_test.go
Keep test daemon sockets under the path limit
[onechat] / prompt_test.go
index e9e87f347b9f2676f5ba5cc8ba46f7c0dd83352f..888057f998e3513bcb62822b0e0348ce48c82bff 100644 (file)
@@ -129,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 {
@@ -166,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")
+}