Skip to content

test: cover toolRegistry selection and metadata helpers - #382

Open
samarth70 wants to merge 1 commit into
exa-labs:mainfrom
samarth70:test/tool-registry-coverage
Open

test: cover toolRegistry selection and metadata helpers#382
samarth70 wants to merge 1 commit into
exa-labs:mainfrom
samarth70:test/tool-registry-coverage

Conversation

@samarth70

Copy link
Copy Markdown

src/toolRegistry.ts had no test coverage, despite holding the pure logic that drives tool selection and metadata. This adds tests/unit/toolRegistry.test.ts covering:

  • isToolEnabledByDefault / requiresUserProvidedApiKey / isAgentTool — reading the registry flags, including isAgentTool agreeing with AGENT_TOOL_IDS across the whole registry.
  • expandToolSelectionagent_tools alias expansion, dedup with first-seen order preserved, dedup across an alias and an explicit member of it, and silent-skip of ids not in the registry.
  • listToolMetadata — only registered tools marked enabled, full-registry coverage, and name/description surfaced for every entry.

Tests only, no source changes. npx vitest run → 124 passed (10 new); tsc --noEmit -p tsconfig.test.json clean.

toolRegistry.ts had no test coverage despite holding the pure logic that drives
tool selection. Add tests/unit/toolRegistry.test.ts for:

- isToolEnabledByDefault / requiresUserProvidedApiKey / isAgentTool reading the
  registry flags (incl. isAgentTool agreeing with AGENT_TOOL_IDS registry-wide);
- expandToolSelection: agent_tools alias expansion, dedup with first-seen order,
  dedup across an alias and an explicit member, and silent-skip of unknown ids;
- listToolMetadata: only registered tools marked enabled, full-registry coverage,
  and name/description surfaced for every entry.

Tests only; no source changes.
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

@samarth70 is attempting to deploy a commit to the Exa Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant