Skip to content

Commit 3eaf6bb

Browse files
scottcmgclaude
andcommitted
feat: map conversationalService.syntheticUserId to runtime context
Add synthetic_user_id to UiPathRuntimeContext plus the fps_mappings entry, so the conversational bridge can present the conversation owner id to CAS on the websocket handshake. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4233a02 commit 3eaf6bb

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/uipath/runtime/context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class UiPathRuntimeContext(BaseModel):
3737
)
3838
exchange_id: str | None = Field(None, description="Exchange identifier for CAS")
3939
message_id: str | None = Field(None, description="Message identifier for CAS")
40+
synthetic_user_id: str | None = Field(
41+
None,
42+
description="Conversation owner id (synthetic user) presented to CAS on the handshake",
43+
)
4044
voice_mode: Literal["session"] | None = Field(
4145
None, description="Voice job type for CAS"
4246
)
@@ -364,6 +368,7 @@ def from_config(
364368
"conversationalService.conversationId": "conversation_id",
365369
"conversationalService.exchangeId": "exchange_id",
366370
"conversationalService.messageId": "message_id",
371+
"conversationalService.syntheticUserId": "synthetic_user_id",
367372
"mcpServer.id": "mcp_server_id",
368373
"mcpServer.slug": "mcp_server_slug",
369374
"voice.mode": "voice_mode",

tests/test_context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def test_from_config_extracts_fps_properties_without_runtime(tmp_path: Path) ->
183183
"conversationalService.conversationId": "conv-123",
184184
"conversationalService.exchangeId": "ex-456",
185185
"conversationalService.messageId": "msg-789",
186+
"conversationalService.syntheticUserId": "owner-guid",
186187
"mcpServer.id": "server-id-123",
187188
"mcpServer.slug": "my-mcp-server",
188189
}
@@ -195,6 +196,7 @@ def test_from_config_extracts_fps_properties_without_runtime(tmp_path: Path) ->
195196
assert ctx.conversation_id == "conv-123"
196197
assert ctx.exchange_id == "ex-456"
197198
assert ctx.message_id == "msg-789"
199+
assert ctx.synthetic_user_id == "owner-guid"
198200
assert ctx.mcp_server_id == "server-id-123"
199201
assert ctx.mcp_server_slug == "my-mcp-server"
200202

0 commit comments

Comments
 (0)