Connecting an Agent to an Assistant doesn't work until cache clear and Tool API
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3564033. --> Reported by: [yautja_cetanu](https://www.drupal.org/user/626050) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>- Create an Agent with the Tool "List Bundles on Entity using the Tool API<br> - Create an Assistant for listning Bundles on Entity and use that agent<br> - Do not clear caches<br> - Explore the created Agent for the Assistant (Get an error)<br> - Attach it to a chatbot (Get an Error)</p> <p><code>The chatbot had an error: The "ai_agents::ai_agent::bundle_lister_agent" plugin does not exist. Valid plugin IDs for Drupal\ai\Service\FunctionCalling\FunctionCallPluginManager are: ai_agent:html_to_markdown, action_plugin:easy_email_send, action_plugin:user_remove_role_action, action_plugin:user_add_role_action, action_plugin:user_block_user_action, action_plugin:user_unblock_user_action, action_plugin:action_send_email_action, action_plugin:entity:unpublish_action:media, action_plugin:entity:unpublish_action:menu_link_content, action_plugin:entity:unpublish_action:node, action_plugin:entity:unpublish_action:path_alias, action_plugin:entity:unpublish_action:redirect, action_plugin:entity:unpublish_action:taxonomy_term, action_plugin:action_goto_action, action_plugin:entity:publish_action:media, action_plugin:entity:publish_action:menu_link_content, action_plugin:entity:publish_action:node, action_plugin:entity:publish_action:path_alias, action_plugin:entity:publish_action:redirect, action_plugin:entity:publish_action:taxonomy_term, action_plugin:entity:save_action:easy_email, action_plugin:entity:save_action:file, action_plugin:entity:save_action:media, action_plugin:entity:save_action:menu_link_content, action_plugin:entity:save_action:node, action_plugin:entity:save_action:taxonomy_term, action_plugin:entity:save_action:user, action_plugin:action_message_action, ai_agent:list_field_display_types, ai_agent:get_current_content_entity_values, ai_agent:get_field_display_form, ai_agent:manipulate_field_config, ai_agent:get_config_schema, ai_agent:get_field_values_and_context, ai_agent:edit_content_type, ai_agent:get_field_config, ai_agent:list_taxonomy_term, ai_agent:get_entity_field_information, ai_agent:agent_ckeditor_output, ai_agent:list_field_types, ai_agent:create_content_type, ai_agent:get_field_storage_form, ai_agent:manipulate_field_display_form, ai_agent:content_entity_field_values_list, ai_agent:content_entity_field_value, ai_agent:create_agent_config_tools_enabled, ai_agent:content_entity_seeder, ai_agent:create_field_storage_config, ai_agent:list_entity_types, ai_agent:vision, ai_agent:list_content_entities, ai_agent:modify_vocabulary, ai_agent:get_field_storage, ai_agent:get_entity_type_field_storage, ai_agent:get_content_type_info, ai_agent:modify_taxonomy_term, ai_agent:get_field_config_form, ai_agent:preparing_response, ai_agent:list_config_entities, ai_agent:list_bundles, tool:entity_delete, tool:entity_load_by_property, tool:entity_field_values, tool:entity_list, tool:entity_save, tool:field_set_value, tool:entity_revision_add, tool:entity_stub, tool:entity_field_value_definitions, tool:entity_load_by_id, tool:entity_translation_get, tool:entity_bundle_list, tool:field_add, tool:field_storage_delete, tool:field_storage_update, tool:field_storage_add, tool:entity_bundle_add, tool:field_type_definitions, tool:field_delete, tool:entity_type_list, tool:entity_bundle_update, tool:entity_bundle_field_definitions, tool:entity_bundle_delete, tool:field_update, tool:entity_bundle_definition, tool:send_email, tool:system_status, tool:log_message, tool:display_message, tool:user_add_role, tool:user_remove_role, tool:user_unblock, tool:user_block, ai_agents::ai_agent::field_type_agent, ai_agents::ai_agent::taxonomy_agent, ai_agents::ai_agent::node_content_type_agent, ai_agents::ai_agent::content_type_agent_triage, ai_agents::ai_agent::drupal_cms_assistant, ai_agents::ai_agent::field_agent_triage, ai_agents::ai_agent::taxonomy_agent_config</code></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>- It is solved by Clearing Caches after creating the Agents and Assistants before running things.</p> <p>Could Automatically do that on Agent save?</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue