fix: use graph_id from current_agent for exclusion in edit_agent

The agent_id parameter might be a library agent ID, not a graph_id,
which could cause incorrect agent exclusion when fetching library agents.
Always use the graph_id from the fetched current_agent.
This commit is contained in:
Zamil Majdy
2026-01-30 14:00:01 -06:00
parent a042c3285d
commit 3a3355befb

View File

@@ -130,11 +130,11 @@ class EditAgentTool(BaseTool):
library_agents = None
if user_id:
try:
exclude_id = current_agent.get("id") or agent_id
graph_id = current_agent.get("id")
library_agents = await get_all_relevant_agents_for_generation(
user_id=user_id,
search_query=changes,
exclude_graph_id=exclude_id,
exclude_graph_id=graph_id,
include_marketplace=True,
)
logger.debug(