wooden-umbrella-84098
09/28/2025, 4:52 AMToolSpec objects and pass the proper classname to them. And also (I think) I have to add from openhands.tools.execute_bash import BashTool to get the tool registered?
I think we could kill two birds with one stone by having a BashToolSpec which automatically sets the class name, and causes the tool to get registeredchilly-france-44439
09/28/2025, 4:56 PMnutritious-balloon-65098
09/28/2025, 4:59 PMnutritious-balloon-65098
09/28/2025, 5:02 PMToolSpec creation with string-based class names
◦ Explicit imports for tool registration
◦ Remembering exact class names and parameters
2. Proposed Solution: Specialized ToolSpec subclasses (like BashToolSpec, FileEditorToolSpec) that:
◦ Automatically register tools on import
◦ Provide type-safe parameters with IDE support
◦ Eliminate string-based class names
◦ Maintain backward compatibility
3. Implementation Plan: Detailed technical approach including:
◦ Base AutoRegisteringToolSpec class
◦ Specialized tool spec classes for each tool
◦ Migration strategy with phases
◦ Success criteria and file modifications needed
4. API Improvement: Shows how the new API would reduce boilerplate by >50% and provide a much cleaner developer experience.
The issue comprehensively addresses both aspects of your concern - eliminating the need to manually create ToolSpec objects with string class names AND automatically handling tool registration through imports. This solution aligns with the repository's engineering principles of simplicity and clarity.
No code changes were made as this was purely an issue creation task. The issue is now available for the development team to prioritize and implement.
<sub>View full conversation</sub>