From 409cdd5a6b44a7134ba808bdda3853103e0cfd76 Mon Sep 17 00:00:00 2001 From: Ryota Yoda Date: Thu, 29 Jan 2026 15:50:52 -0800 Subject: [PATCH] Fix: exclude non-ADK tools from function tool sync Sync only considers tools with ADK freeform tags when merging local and remote function tools; tools created outside ADK (e.g. console) are no longer included in the sync list. --- src/oci/addons/adk/agent.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/oci/addons/adk/agent.py b/src/oci/addons/adk/agent.py index ea9c0050b..e6f4fbe2e 100644 --- a/src/oci/addons/adk/agent.py +++ b/src/oci/addons/adk/agent.py @@ -567,7 +567,7 @@ def _sync_agent_to_remote(self) -> None: def _sync_function_tools_to_remote(self) -> None: """ Synchronize local and remote function tools. - + Only remote tools that have ADK freeform tags are considered (tools created by ADK). """ logger.info("Checking synchronization of local and remote function tools...") local_func_tools = self._local_handler_functions @@ -575,11 +575,13 @@ def _sync_function_tools_to_remote(self) -> None: compartment_id=self.agent_details["compartment_id"], agent_id=self.agent_details["agent_id"], ) + # Filter for active function tools with ADK tags remote_func_tools = [ tool for tool in remote_func_tools - if tool.get("lifecycle_state") == "ACTIVE" and tool.get("tool_config", {}) - .get("tool_config_type") == "FUNCTION_CALLING_TOOL_CONFIG" + if (tool.get("lifecycle_state") == "ACTIVE" + and set(FREEFORM_TAGS.keys()).issubset(tool.get("freeform_tags", {}).keys()) + and tool.get("tool_config", {}).get("tool_config_type") == "FUNCTION_CALLING_TOOL_CONFIG") ] self._log_tool_counts(local_func_tools, remote_func_tools) self._sync_local_and_remote_tools(local_func_tools, remote_func_tools)