Refactor CacheHandler to avoid shadowing built-in input
#3962
+9
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 parameter
inputtotool_inputand updates all cache reads/writes accordingly.CacheHandler.add(tool, input, output)→add(tool, tool_input, output)andread(tool, input)→read(tool, tool_input)increwai/agents/cache/cache_handler.py; update docstrings and cache key construction.crewai/project/utils.pyto usetool_input.crewai/tools/tool_usage.pyto usetool_input.Written by Cursor Bugbot for commit 37cbe4a. This will update automatically on new commits. Configure here.