Repository navigation
Test the agent's tool list against seeded tool nodes and warn on an empty surface - #3457
Conversation
Pragmatic Code ReviewReview Type: Initial review (no prior reviews or comments on the PR) Verdict: APPROVE — no critical or important findings. Three optional suggestions and two nits. SummaryThe PR's central claim is that the defect in the issue does not exist, so it ships tests and a log-level change instead of a reader fix. I checked that claim independently rather than taking it from the PR body, and it holds:
The issue confused the stored shape (bucketed, which is what a database dump shows) with the wire shape the reader receives. Closing it on this basis is justified: the behaviour it asked for already exists, and the PR adds the regression coverage whose absence let the misreading stand. The non-test diff is a doc comment and one Requirements Check
FindingsNo 🔴 Critical or 🟡 Important findings. The node-type sequence does not apply: no type, field, relationship or rule changes. 🟢 Suggestions
Nitpicks
Points checked and found sound
Note for the planned restructure
Recommendation: APPROVE |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressedAll five items from the review are addressed; none skipped.
Targeted tests ( Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The review had no critical or important findings. The follow-up is test tightening, one added |
…mpty surface (closes #3429) available_tools() already builds its surface from the tool nodes: query_nodes returns the wire shape, which flattens the tool bucket, so the top-level reads match what the seeder stores. The new tests pin that against nodes seeded through the real path (edited description and parameter_schema, the trust gate for non-internal tools). The fallback taken when tool nodes exist but none yields a definition now logs at warn instead of debug. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…on a handler-less tool node - The edited-node test now asserts every unedited node yields the registry's own description and parameter schema, not just its name - A tool node with no handler is skipped with a warn instead of silently - The stored-shape premise check asserts the node count, so it cannot pass on an empty result - Log capture uses a closure writer; the MakeWriter impl is gone - Inline comment matches the internal-or-enabled rule Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
8cf7751 to
bb8f513
Compare
Closes #3429
Finding: the reported defect does not reproduce
The issue reads
available_tools()as skipping every tool node because it reads fields from the top level ofpropertieswhile the nodes store them in thetoolbucket. Stored nodes are bucketed, butavailable_tools()reads them throughnode_ops::query_nodes, which returns the wire shape:node_to_typed_valueflattens the type's bucket (parameter_schemaobject included) to the top level. The reader and the writer already agree.The test the issue asked for as confirmation was written first and passes on unmodified
main: an editeddescriptionandparameter_schemareach the returnedToolDefinition, and the trust gate runs. Only the warn test failed before this change.What changed
packages/agent/src/local_agent/tools.rs,available_tools_from_nodes), all against nodes seeded through the real path (prepare_nodes_from_template+seed_nodes_from_templates), each asserting the stored shape is bucketed:descriptionandparameter_schemareach the definition, registry order preservedenabled; an internal tool is offered regardlesswarnand fall back to the hardcoded listdebugtowarn, with the node count, so a reader that stops matching the stored shape cannot fail silently.available_toolsnow says where the fields are read from and lists every fallback.No behaviour change to the tool surface, so the prompt golden is unchanged.
Acceptance criteria
descriptionandparameter_schemareach theToolDefinition— passes before and after, since the defect is not presentenabled: falsetool not offered; internal tool offeredwarn+ fallback (failed before, passes after)bun run test:changedpasses (rust + scripts tiers);bun run quality:fixclean🤖 Generated with Claude Code