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 input parameter to tool_input and updates related cache key usage and call sites in tools handling and sync memoization.

  • Cache:
    • CacheHandler: Rename method parameters inputtool_input in add and read; update docstrings and cache key construction to use tool_input.
  • Tools:
    • agents/tools_handler.py: Update cache.add call to pass tool_input.
    • tools/tool_usage.py: Update cache.read call to pass tool_input.
  • Project Utils:
    • project/utils.py: In sync memoization, switch cache.read/cache.add to use tool_input for the cache key.

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

Copy link

@cursor cursor bot left a 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.

@tosincarik
Copy link
Author

tosincarik commented Nov 29, 2025

@cursoragent check if this my PR #3962 is okay for a merge

Copy link

@cursor cursor bot left a 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.

@tosincarik
Copy link
Author

tosincarik commented Dec 1, 2025

Hi @joaomdmoura , i trust you are well, could you please review the PR and guide me

@tosincarik
Copy link
Author

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

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.

2 participants