Skip to content

Conversation

@goneri
Copy link
Contributor

@goneri goneri commented Dec 3, 2025

Co-Authored-By: Claude noreply@anthropic.com


Note

Adds comprehensive tests for toolset construction, covering aggregation into all, overlaps, invalid entries, order, deduplication, and property/reference preservation.

  • Tests:
    • Add src/index.test.ts covering loadToolsetsFromCfg behavior.
      • Valid configs and overlaps; empty/non-existent tools handling.
      • Aggregation into all and override when all is user-defined.
      • Deduplication by tool name in all when duplicates exist.
      • Preservation of tool properties and object references.
      • Ensures toolset keys present and order maintained; mocks external modules.

Written by Cursor Bugbot for commit eadef9c. This will update automatically on new commits. Configure here.

Co-Authored-By: Claude <noreply@anthropic.com>
]);

return allToolsets;
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test implementation differs from actual code behavior

The test recreates loadToolsetsFromCfg locally rather than importing it, and the test implementation is missing the deduplication logic that exists in the actual implementation in src/index.ts. The real function deduplicates tools by name in the all toolset using a reduce operation, but the test version just flattens all entries directly. This causes tests like "should handle overlapping toolsets correctly" to expect 5 tools in all when the actual implementation would return 3 deduplicated tools.

Additional Locations (2)

Fix in Cursor Fix in Web

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