Skip to content

Conversation

@tosincarik
Copy link

@tosincarik tosincarik commented Nov 22, 2025

Summary
Rename the input parameter in CacheHandler to avoid shadowing Python’s built‑in input, and update all call sites accordingly. Behavior is unchanged; this is a small readability and safety improvement.

Changes

  • lib/crewai/src/crewai/agents/cache/cache_handler.py:
    • Rename:
      add(self, tool: str, input: str, output: Any) -> add(self, tool: str, tool_input: str, output: Any).
    • Rename:
      read(self, tool: str, input: str) -> read(self, tool: str, tool_input: str).
    • Update docstrings and cache key construction to use tool_input.
  • lib/crewai/src/crewai/project/utils.py
    • Update memoization helper to call:
      cache.read(tool=meth.name, tool_input=cache_key)
      cache.add(tool=meth.name, tool_input=cache_key, output=result)
  • lib/crewai/src/crewai/tools/tool_usage.py
    • Update cache lookup to:
      self.tools_handler.cache.read(tool=calling.tool_name, tool_input=input_str)

Rationale

  • Avoids shadowing the built‑in input, which can be confusing and can trip up linters/tooling.
  • Aligns with the existing TODO in CacheHandler to rename this parameter.

Note

Renames CacheHandler parameter input to tool_input and updates all cache reads/writes accordingly.

  • Cache:
    • Rename CacheHandler.add(tool, input, output)add(tool, tool_input, output) and read(tool, input)read(tool, tool_input) in crewai/agents/cache/cache_handler.py; update docstrings and cache key construction.
  • Call sites:
    • Update memoization cache access in crewai/project/utils.py to use tool_input.
    • Update tool cache lookup in crewai/tools/tool_usage.py to use tool_input.

Written by Cursor Bugbot for commit 37cbe4a. This will update automatically on new commits. Configure here.

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