@@ -1380,6 +1380,68 @@ describe("extractMcpToolCallIdentity", () => {
13801380 }
13811381 } ) ;
13821382
1383+ // regression: #33667 OMP mounts MCP tools as xd:// devices and calls them through `write`.
1384+ it ( "recovers T3 identity from OMP xd:// device writes but not its doc reads" , ( ) => {
1385+ const args = {
1386+ html : '<svg width="320" height="120"><rect width="300" height="100" fill="#4f46e5"/></svg>' ,
1387+ title : "Static SVG" ,
1388+ } ;
1389+ const result = {
1390+ htmlRender : { attachmentId : "synthetic-attachment-html" , title : "Static SVG" , height : 136 } ,
1391+ message : "Shown to the reader above your reply." ,
1392+ } ;
1393+ const text = JSON . stringify ( result ) ;
1394+ const created = toolCallFromUpdate ( {
1395+ sessionUpdate : "tool_call" ,
1396+ toolCallId : "toolu_015ATZG99gw99Rrp4htieLux" ,
1397+ title : "Rendering static SVG" ,
1398+ kind : "execute" ,
1399+ status : "pending" ,
1400+ rawInput : { path : "xd://mcp__t3_code_html_render" , content : JSON . stringify ( args ) } ,
1401+ } ) ;
1402+ const completed = mergeToolCallState (
1403+ created ,
1404+ toolCallFromUpdate ( {
1405+ sessionUpdate : "tool_call_update" ,
1406+ toolCallId : "toolu_015ATZG99gw99Rrp4htieLux" ,
1407+ status : "completed" ,
1408+ rawOutput : {
1409+ content : [ { type : "text" , text } ] ,
1410+ details : {
1411+ xdev : {
1412+ tool : "mcp__t3_code_html_render" ,
1413+ mode : "execute" ,
1414+ args,
1415+ tier : "write" ,
1416+ inner : {
1417+ serverName : "t3-code" ,
1418+ mcpToolName : "html_render" ,
1419+ rawContent : [ { type : "text" , text } ] ,
1420+ provider : "acp" ,
1421+ providerName : "ACP Client" ,
1422+ structuredContent : result ,
1423+ } ,
1424+ } ,
1425+ } ,
1426+ } ,
1427+ content : [ { type : "content" , content : { type : "text" , text } } ] ,
1428+ } ) ,
1429+ ) ;
1430+ const docRead = toolCallFromUpdate ( {
1431+ sessionUpdate : "tool_call" ,
1432+ toolCallId : "toolu_read" ,
1433+ title : "Reading html_render schema" ,
1434+ kind : "read" ,
1435+ status : "pending" ,
1436+ rawInput : { path : "xd://mcp__t3_code_html_render" } ,
1437+ } ) ;
1438+
1439+ const expected = { server : "t3-code" , tool : "html_render" , input : args } ;
1440+ expect ( extractMcpToolCallIdentity ( created ) , "pending write" ) . toEqual ( expected ) ;
1441+ expect ( extractMcpToolCallIdentity ( completed ) , "completed write" ) . toEqual ( expected ) ;
1442+ expect ( extractMcpToolCallIdentity ( docRead ) , "doc read" ) . toBeUndefined ( ) ;
1443+ } ) ;
1444+
13831445 it ( "does not claim an agent's own tool that shares a T3 tool name" , ( ) => {
13841446 const toolCall = toolCallFromUpdate ( {
13851447 sessionUpdate : "tool_call" ,
0 commit comments