feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558
Draft
JoshParkSJ wants to merge 1 commit intomainfrom
Draft
feat: add confirmToolCall support to CAS chat bridge [JAR-8666]#1558JoshParkSJ wants to merge 1 commit intomainfrom
JoshParkSJ wants to merge 1 commit intomainfrom
Conversation
4f34984 to
93415af
Compare
1125c2e to
6df4f17
Compare
6df4f17 to
cc0be81
Compare
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.
What changed?
Support the new
confirmToolCallflow in the CAS WebSocket bridge, replacing the legacy interrupt-based tool confirmation entirely.Changes
uipath-core(data models):UiPathConversationToolCallConfirmationEvent— new model forconfirmToolCallevents (approved: bool,input: Any | None)UiPathConversationToolCallStartEvent— addedrequire_confirmationandinput_schemafieldsUiPathConversationToolCallEvent— addedconfirmfield (alias:confirmToolCall)interrupt.py— removed all tool-call-confirmation-specific models (InterruptTypeEnum,ToolCallConfirmationValue,ToolCallConfirmationEndValue, and their interrupt wrappers). Generic interrupt models are retained for deserialization of existing conversation history.uipath(bridge):_bridge.py—_handle_conversation_eventnow detects incomingconfirmToolCallevents and sets the resume event. The oldendInterrupthandler andemit_interrupt_event()method are removed entirely.wait_for_resume()returns the new{approved, input}payload directly.Why rip-and-replace instead of backward compatibility?
We evaluated maintaining backward compat with the old
startInterrupt/endInterruptflow and decided against it:Both sides break the old flow — backward compat is impossible at the system level. PR AgentInterfaces#899 removes the
onInterruptStarthandler fromConversationProvider.tsx, so even if old Python agents emitstartInterrupt, new CAS won't render the confirmation widget. Conversely, old CAS sendsendInterruptwhich new Python won't handle. Neither transition state works — there is no graceful degradation in either direction.Zero production usage. We verified via App Insights telemetry across both
jarvis-prd-eus-ais(CAS) andagents-prd-appins-ne-appins(Python) over 90 days:Agent.ToolCallStartcount ==Agent.ToolCallEndcount (332 each) — no orphaned endToolCall events, meaning no confirmation tools were ever invoked (the old mapper skippedstartToolCallfor confirmation tools, so asymmetry would indicate usage)InterruptStartEvent received from agenttraces in CAS controller logs — the log line atconversation-agent-event.controller.ts:466that fires on every agent interrupt was never hit@requires_approvaldecorator ships in the package but no deployed agent exercises itDeployment is coordinated. CAS deploys first (it doesn't depend on the Python changes), then Python. The tool confirmation feature is staging-only; the brief deployment window has no user impact.
Dead code elimination. The backward compat code in
hitl.py(dual payload parsing for legacy{type, value}shape) was unreachable anyway — the bridge is the only thing delivering resume payloads for conversational agents, and it now only produces the new{approved, input}shape.This is the Python-side counterpart to AgentInterfaces#899 and uipath-langchain-python#703.
How has this been tested?
Are there any breaking changes?