Skip to content

Single tool registry as the source of truth for agent tool name lists #1326

Closed

Description

@malibio

Overview

Agent tool names are written down in four separate places that must stay in agreement. Drift-detector tests exist solely to keep them aligned, which signals the design wants a single registry. This issue introduces one source of truth from which the definitions, display names, and baseline membership are derived.

Problem Statement

The same set of tool names is hand-maintained in four locations:

  1. Tool definitions — all_tool_definitions() in packages/agent/src/local_agent/tools.rs
  2. Humanized display names — humanize_tool_name() in packages/agent/src/local_agent/agent_loop.rs
  3. Baseline always-on tools — BASELINE_TOOLS in packages/agent/src/local_agent/tools.rs
  4. Per-skill tool whitelists — tool_whitelist properties in packages/agent/src/skill_pipeline.rs

A drift-detector test (humanize_tool_name_covers_all_registered_tools) exists only to assert these lists agree. Adding or renaming a tool requires editing several places; forgetting one is caught (if lucky) by a test rather than by the compiler.

Proposed Solution

Define a single registry (e.g. an enum or a const table) that is the authoritative list of tools. Derive from it: the tool definition/JSON schema, the humanized display name, and baseline membership. Skill whitelists should reference registry entries rather than free-form strings where practical. Once derived, the drift-detector tests become unnecessary.

Acceptance Criteria

  • A single registry defines the canonical set of agent tools
  • Tool definition, humanized name, and baseline membership are derived from the registry (not maintained as separate lists)
  • Adding a tool requires editing exactly one place
  • Drift-detector tests that only existed to keep the lists aligned are removed (their guarantee now holds by construction)
  • Skill tool_whitelist references are validated against the registry (unknown tool names are rejected or flagged)
  • Code passes `bun run quality:fix`
  • Tests pass (`bun run test:all`)

Technical Specifications

Reference Files

  • Tool definitions / BASELINE_TOOLS: `packages/agent/src/local_agent/tools.rs`
  • humanize_tool_name: `packages/agent/src/local_agent/agent_loop.rs`
  • Skill whitelists: `packages/agent/src/skill_pipeline.rs`

Parallelization

Scoped to the agent crate's tool registry surface. It touches tools.rs, agent_loop.rs (only humanize_tool_name), and skill_pipeline.rs. It does not change message types, prompt assembly, or daemon wiring, so it runs in parallel with the related issues. Coordinate on agent_loop.rs edits with any concurrent message-type work.

Activity

  1. malibio commented on Jun 5, 2026

    @malibio
    CollaboratorAuthor

    Baseline (agent crate, the crate this issue touches): cargo test -p nodespace-agent --lib → 234 passed, 0 failed. Starting work in worktree issue-1326-tool-registry.

  2. self-assigned this
    on Jun 5, 2026
  3. added a commit that references this issue on Jun 5, 2026
    72f8a55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions