Skip to content

fix: cache prefixed tools per invocation#5744

Closed
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/toolset-prefix-cache-by-invocation
Closed

fix: cache prefixed tools per invocation#5744
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/toolset-prefix-cache-by-invocation

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • Cache prefixed tool lists by invocation_id instead of keeping only the last invocation.
  • Clear the prefix cache in BaseToolset.close().
  • Extend the base toolset tests so inv-1, inv-2, then inv-1 reuses the original inv-1 cache entry.

To verify

  • python -m pytest tests\unittests\tools\test_base_toolset.py -q --basetemp=.tmp\pytest-adk-toolset-full2
  • python -m pyink --check src\google\adk\tools\base_toolset.py tests\unittests\tools\test_base_toolset.py
  • python -m mypy src\google\adk\tools\base_toolset.py
  • python -m py_compile src\google\adk\tools\base_toolset.py tests\unittests\tools\test_base_toolset.py
  • git diff --check upstream/main..HEAD

Fixes #5721

@sasha-gitg
Copy link
Copy Markdown
Collaborator

closing in favor of #5726

@sasha-gitg sasha-gitg closed this May 18, 2026
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.

BaseToolset caches prefixed tools by a single invocation ID, breaking multi-agent concurrency

2 participants