Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/dify_plugin/interfaces/agent/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,20 @@ def _init_prompt_tools(
try:
prompt_tool = self._convert_tool_to_prompt_message_tool(tool)
except Exception:
# api tool may be deleted
logger.exception("Failed to convert tool to prompt message tool")
# api tool may be deleted (e.g. its provider was recreated and
# the app's stored provider_id no longer matches any row in
# tool_api_providers). Naming the tool lets operators grep for
# the drop in plugin_daemon logs instead of guessing why the
# model can't see it.
tool_name = getattr(
getattr(tool, "identity", None), "name", "<unknown>"
)
logger.warning(
"Dropping tool %r from prompt: conversion failed "
"(provider may be deleted or its schema is stale)",
tool_name,
exc_info=True,
)
continue

# save prompt tool
Expand Down