Skip to content

Conversation

@tdan1
Copy link
Contributor

@tdan1 tdan1 commented Aug 12, 2025

  • Fixed typo in field name across CustomAgent and SpoonReactAI classes

🐛 Fix: Rename avaliable_tools to available_tools

Problem
The field avaliable_tools was misspelled throughout the codebase, causing API inconsistency and potential developer confusion.

Solution

  • ✅ Renamed avaliable_tools to available_tools in affected classes
  • ✅ Added backward compatibility with deprecation warnings
  • ✅ Updated all internal references
  • ✅ Added comprehensive test coverage

Changes Made

  • spoon_ai/agents/custom_agent.py: Fixed field name and added compatibility property
  • spoon_ai/agents/spoon_react.py: Fixed field name and added compatibility property
  • tests/test_typo_fix.py: Added test coverage for fix and backward compatibility
  • CHANGELOG.md: Documented the change and deprecation

Testing

  • ✅ All existing tests pass
  • ✅ New tests added with 100% coverage of changed code
  • ✅ Manual testing confirms no breaking changes
  • ✅ Backward compatibility tested with deprecation warnings

Backward Compatibility

Existing code using avaliable_tools will continue to work but will receive deprecation warnings. Migration path:

# Old code (still works, shows warning):
agent.avaliable_tools.add_tool(my_tool)

# New code (recommended):
agent.available_tools.add_tool(my_tool)

 backward compatibility with deprecation warnings
@property
    def avaliable_tools(self):
        """Backward compatibility property for misspelled field name."""
        import warnings
        warnings.warn(
            "avaliable_tools is deprecated and will be removed in v2.0. "
            "Use available_tools instead.",
            DeprecationWarning,
            stacklevel=2
        )
        return self.available_tools
@avaliable_tools.setter
def avaliable_tools(self, value):
    """Backward compatibility setter for misspelled field name."""
    import warnings
    warnings.warn(
        "avaliable_tools is deprecated and will be removed in v2.0. "
        "Use available_tools instead.",
        DeprecationWarning,
        stacklevel=2
    )
    self.available_tools = value

…ility - Fixed typo in field name across CustomAgent and SpoonReactAI classes
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