-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Refactor CacheHandler to avoid shadowing built-in input
#3962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor CacheHandler to avoid shadowing built-in input
#3962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
@cursoragent check if this my PR #3962 is okay for a merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
Hi @joaomdmoura , i trust you are well, could you please review the PR and guide me |
|
happy weekend to you @greysonlalonde , i trust you are doing well today ? i was wondering if you could please review the PR and guide me on the necessary steps to take |
Summary
Rename the
inputparameter inCacheHandlerto avoid shadowing Python’s built‑ininput, and update all call sites accordingly. Behavior is unchanged; this is a small readability and safety improvement.Changes
add(self, tool: str, input: str, output: Any)->add(self, tool: str, tool_input: str, output: Any).read(self, tool: str, input: str)->read(self, tool: str, tool_input: str).tool_input.cache.read(tool=meth.name, tool_input=cache_key)cache.add(tool=meth.name, tool_input=cache_key, output=result)self.tools_handler.cache.read(tool=calling.tool_name, tool_input=input_str)Rationale
input, which can be confusing and can trip up linters/tooling.CacheHandlerto rename this parameter.Note
Renames CacheHandler
inputparameter totool_inputand updates related cache key usage and call sites in tools handling and sync memoization.CacheHandler: Rename method parametersinput→tool_inputinaddandread; update docstrings and cache key construction to usetool_input.agents/tools_handler.py: Updatecache.addcall to passtool_input.tools/tool_usage.py: Updatecache.readcall to passtool_input.project/utils.py: In sync memoization, switchcache.read/cache.addto usetool_inputfor the cache key.Written by Cursor Bugbot for commit 69d5b88. This will update automatically on new commits. Configure here.