Skip to content

feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558

Open
JoshParkSJ wants to merge 2 commits intomainfrom
josh/cas-confirm-tool-call
Open

feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558
JoshParkSJ wants to merge 2 commits intomainfrom
josh/cas-confirm-tool-call

Conversation

@JoshParkSJ
Copy link
Copy Markdown
Contributor

@JoshParkSJ JoshParkSJ commented Apr 11, 2026

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 startInterrupt event (carrying tool-call metadata), waited for a matching endInterrupt event keyed on an interrupt_id, then resumed the agent with the approval result. Tool confirmation was a passenger inside a general-purpose interrupt envelope.

The new model

startToolCall now carries requireConfirmation: true and inputSchema directly, so CAS sees immediately — at tool invocation time — that this call needs user approval. The user's decision comes back as a confirmToolCall event 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

  • Data models (uipath-core): interrupt.py deleted entirely. Confirmation state (requireConfirmation, inputSchema, confirmation) moves onto the tool call models. A new UiPathConversationToolCallConfirmationEvent carries the user's approve/reject decision.
  • Bridge (_bridge.py): Drops the interrupt-ID-matching logic. Now just watches for confirmToolCall on incoming tool call events and sets the resume event. emit_interrupt_event() is kept as a documented no-op to satisfy the UiPathChatProtocol contract — it has no work to do in this flow.
  • Cleanup: interrupts field removed from message models; interrupt field removed from UiPathConversationMessageEvent. 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

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository test:uipath-runtime labels Apr 11, 2026
@JoshParkSJ JoshParkSJ force-pushed the josh/cas-confirm-tool-call branch from 4f34984 to 93415af Compare April 12, 2026 15:03
@JoshParkSJ JoshParkSJ force-pushed the josh/cas-confirm-tool-call branch 7 times, most recently from 6df4f17 to cc0be81 Compare April 14, 2026 13:40
@JoshParkSJ JoshParkSJ marked this pull request as ready for review April 14, 2026 22:08
@JoshParkSJ JoshParkSJ force-pushed the josh/cas-confirm-tool-call branch 3 times, most recently from f07a4c1 to 9b20567 Compare April 15, 2026 02:01
@JoshParkSJ JoshParkSJ force-pushed the josh/cas-confirm-tool-call branch 3 times, most recently from d41a431 to 1dbe8ff Compare April 15, 2026 13:44
@JoshParkSJ JoshParkSJ force-pushed the josh/cas-confirm-tool-call branch from 1dbe8ff to 319a5e6 Compare April 15, 2026 13:47
``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.
"""
Copy link
Copy Markdown
Contributor Author

@JoshParkSJ JoshParkSJ Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant