@@ -871,6 +871,21 @@ describe("browser tool snapshot maxChars", () => {
871871 expect ( browserClientMocks . browserStatus ) . not . toHaveBeenCalled ( ) ;
872872 } ) ;
873873
874+ it . each ( [
875+ [ "target=node" , { target : "node" } ] ,
876+ [ "an explicit node pin" , { node : "node-1" } ] ,
877+ [ "automatic node routing" , { } ] ,
878+ ] ) ( "blocks %s when host control is disabled" , async ( _label , route ) => {
879+ mockSingleBrowserProxyNode ( ) ;
880+ const tool = createBrowserTool ( { allowHostControl : false } ) ;
881+
882+ await expect ( tool . execute ?.( "call-1" , { action : "status" , ...route } ) ) . rejects . toThrow (
883+ / b r o w s e r c o n t r o l i s d i s a b l e d b y s a n d b o x p o l i c y / i,
884+ ) ;
885+ expect ( gatewayMocks . callGatewayTool ) . not . toHaveBeenCalled ( ) ;
886+ expect ( browserClientMocks . browserStatus ) . not . toHaveBeenCalled ( ) ;
887+ } ) ;
888+
874889 it ( "fails node proxy calls cleanly when payloadJSON is malformed" , async ( ) => {
875890 mockSingleBrowserProxyNode ( ) ;
876891 gatewayMocks . callGatewayTool . mockResolvedValueOnce ( {
@@ -1247,7 +1262,7 @@ describe("browser tool snapshot maxChars", () => {
12471262 setResolvedBrowserProfiles ( {
12481263 user : { driver : "existing-session" , attachOnly : true , color : "#00AA00" } ,
12491264 } ) ;
1250- const tool = createBrowserTool ( ) ;
1265+ const tool = createBrowserTool ( { allowHostControl : true } ) ;
12511266 await tool . execute ?.( "call-1" , { action : "status" , profile : "user" , target : "node" } ) ;
12521267
12531268 const { options, request } = lastNodeInvokeCall ( ) ;
0 commit comments