Make tools cloneable#445
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a CloneableTool class in ymir/tools/base.py that extends the base Tool class with an asynchronous clone method. This new base class is then integrated across multiple privileged and unprivileged tool modules by replacing the standard Tool import. Feedback was provided to enhance the clone method's reliability by adding safety checks for None values and preventing shared state issues with the options dictionary through explicit copying.
983d6cb to
0600415
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a CloneableTool base class in ymir/tools/base.py and updates various privileged and unprivileged tools to use this new class. The primary goal is to provide a mechanism for cloning tool instances. A review comment correctly identifies several critical issues in the clone method implementation, including potential AttributeError exceptions when modifying middlewares and accessing cache, as well as the risk of shared state between clones due to shallow copying of the options attribute.
28d83f4 to
093b333
Compare
Signed-off-by: Nikola Forró <nforro@redhat.com> Assisted-by: Claude Opus 4.6 via Claude Code
|
do I understand correctly that you've fixed this issue in BeeAI upstream, so we don't have to apply this workaround? |
No. This isn't a workaround and there is no upstream issue, not unless upstream decides their implementation is wrong/unfortunate, then there would be no need for this PR. |
oh, I see. I've got confused with the PR you did to BeeAI |
No description provided.