(t *testing.T)
| 585 | } |
| 586 | |
| 587 | func TestAllowedBehaviorToolNames(t *testing.T) { |
| 588 | t.Parallel() |
| 589 | |
| 590 | makeTools := func(names ...string) []fantasy.AgentTool { |
| 591 | tools := make([]fantasy.AgentTool, 0, len(names)) |
| 592 | for _, name := range names { |
| 593 | tools = append(tools, newTestAgentTool(name)) |
| 594 | } |
| 595 | return tools |
| 596 | } |
| 597 | |
| 598 | allTools := makeTools("read_file", "custom_tool", "spawn_agent") |
| 599 | exploreMode := database.NullChatMode{ |
| 600 | ChatMode: database.ChatModeExplore, |
| 601 | Valid: true, |
| 602 | } |
| 603 | |
| 604 | t.Run("DefaultModeReturnsAllTools", func(t *testing.T) { |
| 605 | t.Parallel() |
| 606 | require.Equal(t, []string{"read_file", "custom_tool", "spawn_agent"}, allowedBehaviorToolNames( |
| 607 | allTools, |
| 608 | database.NullChatMode{}, |
| 609 | )) |
| 610 | }) |
| 611 | |
| 612 | t.Run("ExploreModeUsesExploreAllowlist", func(t *testing.T) { |
| 613 | t.Parallel() |
| 614 | require.Equal(t, []string{"read_file"}, allowedBehaviorToolNames( |
| 615 | allTools, |
| 616 | exploreMode, |
| 617 | )) |
| 618 | }) |
| 619 | } |
| 620 | |
| 621 | func TestStopAfterPlanTools(t *testing.T) { |
| 622 | t.Parallel() |
nothing calls this directly
no test coverage detected