]> git.giacomolli.uk - onechat/blobdiff - prompt_test.go
Store the subagents and read them with zoom
[onechat] / prompt_test.go
index 4c88ad8a80d2683573ccc877523488691f6de5ac..5b10597bb755c1f629eefd823ca588a12573f527 100644 (file)
@@ -16,6 +16,7 @@ func TestPromptNamesTheAgent(t *testing.T) {
        require.Contains(t, text, "- reply: Ada's replies")
        require.Contains(t, text, "Goal: let Ada work later")
        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)
 
        // The old agent name is built from parts, so the source does not spell
@@ -25,7 +26,7 @@ func TestPromptNamesTheAgent(t *testing.T) {
 
 func TestPromptLeavesOutAbsentFeatures(t *testing.T) {
        text := prompt("Ada", "")
-       for _, absent := range []string{"image", "ubagent", "computer", "device", `zoom("Name")`, "instructions at the end"} {
+       for _, absent := range []string{"image", "ubagent", "computer", "device", "instructions at the end"} {
                require.NotContains(t, text, absent)
        }
 }
@@ -47,8 +48,13 @@ func TestPromptWithoutInstructionsHasNoClause(t *testing.T) {
 }
 
 func TestAgentToolsAreStrictAndStable(t *testing.T) {
-       tools := agentTools()
-       require.Equal(t, []string{"zoom", "date"}, []string{tools[0].Name, tools[1].Name})
+       tools := promptTools()
+       names := make([]string, len(tools))
+       for n, tool := range tools {
+               names[n] = tool.Name
+       }
+
+       require.Equal(t, []string{"zoom", "date", "shell", "read", "write", "edit"}, names)
 
        for _, tool := range tools {
                schema := tool.Parameters.(map[string]any)
@@ -62,7 +68,7 @@ func TestAgentToolsAreStrictAndStable(t *testing.T) {
        require.NoError(t, err)
 
        for range 10 {
-               again, err := json.Marshal(agentTools())
+               again, err := json.Marshal(promptTools())
                require.NoError(t, err)
                require.Equal(t, first, again)
        }