mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Route IWC workflow imports to the tool recommendation agent
The router had no home for "import an IWC workflow" -- there's no import handoff, and import_workflow_from_iwc only exists on the operations/MCP side, not as an in-app tool. So the request scattered: on gpt-oss-120b (the demo/test model) "import a histological staining workflow from IWC" landed on the plain router 4 times out of 5 and answered with a how-to essay instead of surfacing anything importable. tool_recommendation already searches the IWC catalog and emits a WORKFLOW_IMPORT action for what it finds, so point the router there for IWC import asks via both the prompt and the handoff docstring -- and widen the handoff summary/arg, which still described it as tools-only. Also fixes the stale routing eval case that expected router. With this the imperative "import..." prompts route to tool_recommendation 5/5.
This commit is contained in:
@@ -99,6 +99,7 @@ English. If the request really wants analysis (e.g. "summarize my history",
|
||||
- Wants to find/discover tools ("Is there a tool that converts BAM to FASTQ?")
|
||||
- Needs help choosing between tools for an analysis type
|
||||
- Asks "what tools are available for X?"
|
||||
- Asks to import or find a workflow from IWC for an analysis ("import an IWC workflow for X", "is there an IWC workflow for X I can import?") -- it searches the IWC catalog and surfaces an import action; there is no separate import handoff
|
||||
|
||||
**Use `hand_off_to_error_analysis`** when user PROVIDES specific error details:
|
||||
|
||||
@@ -158,6 +159,7 @@ Key pattern: If user needs to FIND something (job, dataset, history) before anal
|
||||
|
||||
- "What tool should I use for X?" → Use hand_off_to_tool_recommendation
|
||||
- "Is there a tool that does X?" → Use hand_off_to_tool_recommendation
|
||||
- "Import an IWC workflow for X" → Use hand_off_to_tool_recommendation (surfaces the workflow + import action)
|
||||
- "How do I use tool X?" → Answer directly (usage help)
|
||||
- "What parameters does X need?" → Answer directly (usage help)
|
||||
- "Create a tool that does X" → Use hand_off_to_custom_tool
|
||||
|
||||
@@ -5,7 +5,7 @@ Uses pydantic-ai output functions to either:
|
||||
- Answer general Galaxy questions directly (returns str)
|
||||
- Hand off to error_analysis for job debugging
|
||||
- Hand off to custom_tool for explicit tool creation requests
|
||||
- Hand off to tool_recommendation for tool discovery
|
||||
- Hand off to tool_recommendation for tool and IWC workflow discovery
|
||||
- Hand off to gtn_training for tutorial and learning requests
|
||||
|
||||
Also exposes a small set of @agent.tool fast-path tools for read-only browsing
|
||||
@@ -330,13 +330,14 @@ class QueryRouterAgent(BaseGalaxyAgent):
|
||||
ctx: RunContext[GalaxyAgentDependencies],
|
||||
query: str,
|
||||
) -> str:
|
||||
"""Route to tool recommendation agent for finding Galaxy tools.
|
||||
"""Route to tool recommendation agent for finding Galaxy tools and IWC workflows.
|
||||
|
||||
Use this when the user:
|
||||
- Asks what tool to use for a task ("what tool aligns reads?")
|
||||
- Wants to find tools for a specific analysis type
|
||||
- Needs help discovering available tools
|
||||
- Asks "is there a tool that does X?"
|
||||
- Asks to import or find a workflow from IWC for an analysis (it searches IWC and surfaces an import action)
|
||||
|
||||
Do NOT use for:
|
||||
- How to USE a specific tool (answer directly)
|
||||
@@ -344,7 +345,7 @@ class QueryRouterAgent(BaseGalaxyAgent):
|
||||
- Job errors (use hand_off_to_error_analysis)
|
||||
|
||||
Args:
|
||||
query: The tool discovery question
|
||||
query: The tool or workflow discovery question
|
||||
"""
|
||||
return await self._execute_handoff(ctx, AgentType.TOOL_RECOMMENDATION, query)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user