Skip to content

Conversation

Unshure
Copy link
Member

@Unshure Unshure commented Sep 30, 2025

Description

Fix the issue where we do not detect tools in the local tools repo if no tools exits in it initially. This fix updates the agent behavior where if the tools repo exists with no tools, it will detect tools added to the directory.

Note: This feature will not detect tools if the directory does not exits. The directory must exist first, and can be empty, for this feature to work.

Related Issues

#264

Documentation PR

TBD

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Unshure Unshure marked this pull request as ready for review September 30, 2025 17:36
logger.debug("tools_dir=<%s> | found tools directory", directory)
else:
logger.debug("tools_dir=<%s> | tools directory not found", directory)
logger.debug(
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to throw? I feel like if you enable this option and there is no directory, it's not obvious that it's not going to work.

I feel like because they explicitly opt-ed in, we should either throw or create the directory

Copy link
Member Author

@Unshure Unshure Sep 30, 2025

Choose a reason for hiding this comment

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

Backwards compatibility ¯\_(ツ)_/¯

I actually mean to update this to a warning instead of debug, so at least this is more visible

master_handler = self.MasterChangeHandler(dir_str)
ToolWatcher._shared_observer.schedule(master_handler, dir_str, recursive=False)

ToolWatcher._shared_observer.schedule(master_handler, str(tools_dir), recursive=False)
Copy link
Member

Choose a reason for hiding this comment

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

sorry, can you explain why this is fixing the bug? Is there some mutation happening?

Like like L111 has dir_str = str(tools_dir) so I'm not sure whats changing?

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.

3 participants