Repository navigation
Closed
Labels
Description
Overview
The local agent is meant to build its tool surface from the seeded tool nodes, so a tool node's description, parameter_schema and enabled take effect, and so a non-internal tool must be enabled before it is offered. As far as can be read from the code, available_tools() never actually uses the nodes. It reads their fields from the wrong place, skips every node, and falls back to the hardcoded list.
Problem Statement
- Seeded tool nodes store their fields in the
toolbucket:properties.tool.handler,.description,.parameter_schema,.source,.enabled. All 21 nodes in a current local database have that shape, andToolNodeBehavior(packages/core/src/behaviors/mod.rs) reads them from the bucket (get_namespaced_prop_str(&node.properties, "tool", "handler")). available_tools()(packages/agent/src/local_agent/tools.rs) queries the tool nodes, but reads each field from the top level ofproperties:props.get("handler"),props.get("source"),props.get("enabled"),props.get("description"),props.get("parameter_schema").- So
handlerreads as empty for every node, every node is skipped,node_defsstays empty, and the function returnsmodel_facing_tool_definitions(), the hardcoded list. - Consequences:
- Editing a tool node's description or parameter schema has no effect.
enabled: falsedoes not remove a tool.- The trust gate for non-internal tools (
source == "internal" || enabled) never runs.
available_tools_returns_every_model_facing_toolpasses either way, because the fallback returns the same names.
Proposed Solution
- Write a test that seeds bucketed tool nodes with a changed description and
enabled: falseon one tool, and assert they take effect. This confirms the defect: the test should fail onmain. - Read the fields from the
toolbucket, with the same helperToolNodeBehavioruses, so reader and writer agree. - Keep the fallback only for a missing node service or an empty query, and log at
warnif tool nodes exist but none produced a definition, so this can't silently recur.
Acceptance Criteria
- A test seeds bucketed tool nodes and asserts that an edited
descriptionandparameter_schemareach the returnedToolDefinition; it fails before the fix and passes after - A tool node with
enabled: falseand a non-internalsourceis not offered; an internal tool is offered (test) - When tool nodes exist but none yield a definition, a
warnis logged and the fallback is used (test) - Prompt golden unchanged, or regenerated with the diff reviewed if seeded descriptions differ from the hardcoded ones
-
bun run test:changedpasses;bun run quality:fixclean
Technical Specifications
Reference Files
- Reader:
packages/agent/src/local_agent/tools.rs(available_tools,model_facing_tool_definitions,is_system_only_tool) - Writer and validator:
packages/core/src/behaviors/mod.rs(ToolNodeBehavior,get_namespaced_prop_str) - Seeds:
packages/agent/src/skill_pipeline.rs(seed_tool_nodes)
Architecture Impact
ADR-038 says tools may be stored as registry nodes, and the model is presented typed tools generated from those nodes. This fix makes that true. A planned restructure turns tool into an abstract base with a tool-native subtype and drops source. This fix is independent of it and lands first.
Non-Goals
- The
tool/tool-nativerestructure - Tool semantic search
- Remote tools
Activity
malibio commentedon Oct 1, 2026
Frontend: 298 test files passed (5510 tests)
Test the agent's tool list against seeded tool nodes and warn on an e…