File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2222 extract_current_tool_call_index ,
2323 find_latest_ai_message ,
2424)
25- from uipath_langchain .agent .tools .durable_interrupt import add_interrupt_offset
2625from uipath_langchain .chat .hitl import request_conversational_tool_confirmation
2726
2827# the type safety can be improved with generics
@@ -90,7 +89,6 @@ def _func(self, state: AgentGraphState) -> OutputType:
9089 if conversational_confirmation .cancelled :
9190 # tool confirmation rejected
9291 return self ._process_result (call , conversational_confirmation .cancelled )
93- add_interrupt_offset () # HITL consumed 1 interrupt slot
9492
9593 try :
9694 if self .wrapper :
@@ -128,7 +126,6 @@ async def _afunc(self, state: AgentGraphState) -> OutputType:
128126 if conversational_confirmation .cancelled :
129127 # tool confirmation rejected
130128 return self ._process_result (call , conversational_confirmation .cancelled )
131- add_interrupt_offset () # HITL consumed 1 interrupt slot
132129
133130 try :
134131 if self .awrapper :
Original file line number Diff line number Diff line change 1212 UiPathConversationToolCallConfirmationValue ,
1313)
1414
15+ from uipath_langchain .agent .tools .durable_interrupt import add_interrupt_offset
16+
1517CANCELLED_MESSAGE = "Cancelled by user"
1618
1719CONVERSATIONAL_APPROVED_TOOL_ARGS = "conversational_approved_tool_args"
@@ -127,6 +129,9 @@ def request_approval(
127129 input_value = tool_args ,
128130 )
129131 )
132+ # Workaround for langgraph#6792 — remove when subgraph @task + interrupt()
133+ # checkpoint caching is fixed upstream
134+ add_interrupt_offset ()
130135
131136 # The resume payload from CAS has shape:
132137 # {"type": "uipath_cas_tool_call_confirmation",
@@ -145,6 +150,7 @@ def request_approval(
145150 )
146151
147152
153+ # for conversational low code agents
148154def request_conversational_tool_confirmation (
149155 call : ToolCall , tool : BaseTool
150156) -> ConfirmationResult | None :
@@ -176,6 +182,7 @@ def request_conversational_tool_confirmation(
176182 )
177183
178184
185+ # for conversational coded agents
179186def requires_approval (
180187 func : Callable [..., Any ] | None = None ,
181188 * ,
You can’t perform that action at this time.
0 commit comments