Fix ADK tag filtering for function tool sync #825
+5
−3
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.
When
agent.setup()ran function-tool sync (_sync_function_tools_to_remote), it treated all remote function-calling tools as sync targets. That included tools created outside ADK (e.g. in the OCI console or by other clients) that do not have ADK freeform tags (ConfiguredByADK).As a result:
Root Cause
In
agent.py,_sync_function_tools_to_remote()used every tool returned byfind_tools()that hadtool_config_type == "FUNCTION_CALLING_TOOL_CONFIG", without checking ADK ownership. RAG and SQL tool sync already filtered by ADK freeform tags; function tool sync did not.Fix
Function tool sync now uses the same ADK tag filter as RAG and SQL sync. Before calling
_sync_local_and_remote_tools(), we restrictremote_func_toolsto tools that:lifecycle_state == "ACTIVE", andFREEFORM_TAGSkeys are present infreeform_tags), andtool_config_type == "FUNCTION_CALLING_TOOL_CONFIG".Only those remote tools are passed into sync. Tools created outside ADK (e.g. in the console, without ADK tags) are no longer part of the sync list and are left unchanged by ADK.