feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558
feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558JoshParkSJ wants to merge 4 commits intomainfrom
Conversation
4f34984 to
93415af
Compare
6df4f17 to
cc0be81
Compare
f07a4c1 to
9b20567
Compare
d41a431 to
1dbe8ff
Compare
1dbe8ff to
319a5e6
Compare
| ``interrupt("do you want to continue?")``). Nothing uses that today | ||
| and it's not a near-term requirement — the method is kept for | ||
| generic flexibility. | ||
| """ |
There was a problem hiding this comment.
I still believe for conversational experience we won't ever need to support this type of generic interrupt. This type of interrupt("...") is really for workflow type / autonomous agent experience. But Pufu's suggestion was that there's no cost of keeping this runtime protocol here as a no-op and potential flexibility. So keeping it here. For CAS code though, removing interrupt simplifies our codebase significantly - so doing a rip-and-replace makes sense
| """No-op. | ||
|
|
||
| Tool confirmation — the only interrupt pattern CAS uses today — is | ||
| handled end-to-end via ``startToolCall`` with ``requireConfirmation: | ||
| true`` paired with ``wait_for_resume()``. This is deliberately | ||
| simpler than the old interrupt-based flow: CAS needs | ||
| ``requireConfirmation`` on the tool call event itself to render the | ||
| confirmation UI, so a parallel ``startInterrupt`` event would be | ||
| redundant. | ||
|
|
||
| The only hypothetical reason to put work here is a generic, | ||
| non-tool-call agent interrupt (e.g. a coded agent calling | ||
| ``interrupt("do you want to continue?")``). Nothing uses that today | ||
| and it's not a near-term requirement — the method is kept for | ||
| generic flexibility. | ||
| """ | ||
| return None |
There was a problem hiding this comment.
Thanks for the comment but can we just remove emit_interrupt_event and its references in all the other files?
There was a problem hiding this comment.
Yeah I wanted to delete it but Pufu wanted the runtime repo to be untouched in case we have to add it back in the future. He said just no-op it here
Resolved conflicts in pyproject.toml and uv.lock — bumped version to 2.10.56.
What changed?
Tool confirmation is no longer modeled as an interrupt — it is now a first-class property of the tool call itself.
The old model
The old flow used a separate interrupt mechanism: when a tool needed user approval, the bridge emitted a
startInterruptevent (carrying tool-call metadata), waited for a matchingendInterruptevent keyed on aninterrupt_id, then resumed the agent with the approval result. Tool confirmation was a passenger inside a general-purpose interrupt envelope.The new model
startToolCallnow carriesrequireConfirmation: trueandinputSchemadirectly, so CAS sees immediately — at tool invocation time — that this call needs user approval. The user's decision comes back as aconfirmToolCallevent on the same tool call, with{ approved, input }. No interrupt envelope, no ID matching, no parallel event streams.This is a tighter fit: confirmation is a property of the tool call, so it lives on the tool call event.
What this means in practice
uipath-core):interrupt.pydeleted entirely. Confirmation state (requireConfirmation,inputSchema,confirmation) moves onto the tool call models. A newUiPathConversationToolCallConfirmationEventcarries the user's approve/reject decision._bridge.py): Drops the interrupt-ID-matching logic. Now just watches forconfirmToolCallon incoming tool call events and sets the resume event.emit_interrupt_event()is kept as a documented no-op to satisfy theUiPathChatProtocolcontract — it has no work to do in this flow.interruptsfield removed from message models;interruptfield removed fromUiPathConversationMessageEvent. All call sites updated.Testing
Manual end-to-end with tc-1 agent: Accept, Cancel, Modify+Accept, and empty required field validation all verified working for low code and coded agents
Companion PRs