explore-tools.test.ts 962 B

123456789101112131415161718192021222324252627282930313233
  1. import { describe, expect, it } from "vitest";
  2. import {
  3. buildExploreAllowedTools,
  4. formatExploreAllowedToolsForAgentDescription,
  5. } from "../src/subagent/explore-tools.js";
  6. describe("Explore tool policy", () => {
  7. it("keeps direct and embedded-search Explore tool lists in sync with provider-visible text", () => {
  8. expect(buildExploreAllowedTools()).toEqual([
  9. "Bash",
  10. "Glob",
  11. "Grep",
  12. "Read",
  13. "WebFetch",
  14. "WebSearch",
  15. "TodoWrite",
  16. ]);
  17. expect(formatExploreAllowedToolsForAgentDescription()).toBe(
  18. "Glob, Grep, Read, Bash, WebFetch, WebSearch, TodoWrite",
  19. );
  20. expect(buildExploreAllowedTools({ embeddedSearchEnabled: true })).toEqual([
  21. "Bash",
  22. "Read",
  23. "WebFetch",
  24. "WebSearch",
  25. "TodoWrite",
  26. ]);
  27. expect(
  28. formatExploreAllowedToolsForAgentDescription({ embeddedSearchEnabled: true }),
  29. ).toBe("Read, Bash, WebFetch, WebSearch, TodoWrite");
  30. });
  31. });