fix: use resource.name for mockable in process_tool#614
Merged
Conversation
PR #546 changed the @mockable name from resource.name to tool_name.lower(), which breaks tool simulation. The sanitized and lowercased name (e.g. "api_workflow") no longer matches the original name in simulation.json (e.g. "API Workflow"), causing the LLM mocker to skip simulation for process tools. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chibionos
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes tool simulation (
uipath debug) failing in two ways:Bug 1:
@mockablename mismatchprocess_tool.pyandescalation_tool.pyusedname=tool_name.lower()(e.g.api_workflow) instead ofname=resource.name(e.g.API Workflow). This causedLLMMockerto raiseUiPathNoMockFoundErrorbecause the name didn't matchsimulation.json'stoolsToSimulate[].name.Fallback behavior: When
UiPathNoMockFoundErroris raised, the@mockabledecorator silently falls through to the real tool function (mockable.py:mocked_response_decorator). This means tools configured for simulation would execute against the actual UiPath platform instead, failing with HTTP 400 errors indebug/eval contexts.
Bug 2: Empty kwargs in
@mockable-decorated nested functionsSeveral tools define a nested function decorated with
@mockablethat takes no arguments (e.g.async def invoke_process():), even though the outer function receives**kwargs. The@mockabledecorator captures function arguments to build thecurrentToolInputfield in the mock LLM prompt. With no arguments,the mock LLM sees
{"args": [], "kwargs": {}}and returns null results, causing the agent to loop until max iterations.Files changed
process_tool.pyresource.nameinvoke_process(**_tool_kwargs)escalation_tool.pyresource.nameescalate(**_tool_kwargs)deeprag_tool.pyinvoke_deeprag(**_tool_kwargs)batch_transform_tool.pyinvoke_batch_transform(**_tool_kwargs)No changes needed:
integration_tool.py,context_tool.py,analyze_files_tool.py,mcp_tool.py,ixp_escalation_tool.py— these either decorate the top-level function directly (kwargs flow through naturally) or have no user-provided inputs.Test plan
uipath debugon an agent with a process tool configured for simulation — verify mock interception works and returns non-null resultsuipath debugon an agent with an escalation tool configured for simulationuipath evalto confirm evaluation pipeline works end-to-endRCA
PR #546 introduced Bug 1 (name mismatch) for process_tool.py only.
The diff shows it moved the @mockable decorator from the outer process_tool_fn level to a new nested invoke_process() function, and in doing so made two changes:
🤖 Generated with Claude Code