@@ -28,6 +28,7 @@ describe("MCP Servers and Custom Agents", async () => {
2828 } ;
2929
3030 const session = await client . createSession ( {
31+ onPermissionRequest : approveAll ,
3132 mcpServers,
3233 } ) ;
3334
@@ -44,7 +45,7 @@ describe("MCP Servers and Custom Agents", async () => {
4445
4546 it ( "should accept MCP server configuration on session resume" , async ( ) => {
4647 // Create a session first
47- const session1 = await client . createSession ( ) ;
48+ const session1 = await client . createSession ( { onPermissionRequest : approveAll } ) ;
4849 const sessionId = session1 . sessionId ;
4950 await session1 . sendAndWait ( { prompt : "What is 1+1?" } ) ;
5051
@@ -59,6 +60,7 @@ describe("MCP Servers and Custom Agents", async () => {
5960 } ;
6061
6162 const session2 = await client . resumeSession ( sessionId , {
63+ onPermissionRequest : approveAll ,
6264 mcpServers,
6365 } ) ;
6466
@@ -89,6 +91,7 @@ describe("MCP Servers and Custom Agents", async () => {
8991 } ;
9092
9193 const session = await client . createSession ( {
94+ onPermissionRequest : approveAll ,
9295 mcpServers,
9396 } ) ;
9497
@@ -136,6 +139,7 @@ describe("MCP Servers and Custom Agents", async () => {
136139 ] ;
137140
138141 const session = await client . createSession ( {
142+ onPermissionRequest : approveAll ,
139143 customAgents,
140144 } ) ;
141145
@@ -152,7 +156,7 @@ describe("MCP Servers and Custom Agents", async () => {
152156
153157 it ( "should accept custom agent configuration on session resume" , async ( ) => {
154158 // Create a session first
155- const session1 = await client . createSession ( ) ;
159+ const session1 = await client . createSession ( { onPermissionRequest : approveAll } ) ;
156160 const sessionId = session1 . sessionId ;
157161 await session1 . sendAndWait ( { prompt : "What is 1+1?" } ) ;
158162
@@ -167,6 +171,7 @@ describe("MCP Servers and Custom Agents", async () => {
167171 ] ;
168172
169173 const session2 = await client . resumeSession ( sessionId , {
174+ onPermissionRequest : approveAll ,
170175 customAgents,
171176 } ) ;
172177
@@ -193,6 +198,7 @@ describe("MCP Servers and Custom Agents", async () => {
193198 ] ;
194199
195200 const session = await client . createSession ( {
201+ onPermissionRequest : approveAll ,
196202 customAgents,
197203 } ) ;
198204
@@ -219,6 +225,7 @@ describe("MCP Servers and Custom Agents", async () => {
219225 ] ;
220226
221227 const session = await client . createSession ( {
228+ onPermissionRequest : approveAll ,
222229 customAgents,
223230 } ) ;
224231
@@ -244,6 +251,7 @@ describe("MCP Servers and Custom Agents", async () => {
244251 ] ;
245252
246253 const session = await client . createSession ( {
254+ onPermissionRequest : approveAll ,
247255 customAgents,
248256 } ) ;
249257
@@ -273,6 +281,7 @@ describe("MCP Servers and Custom Agents", async () => {
273281 ] ;
274282
275283 const session = await client . createSession ( {
284+ onPermissionRequest : approveAll ,
276285 mcpServers,
277286 customAgents,
278287 } ) ;
0 commit comments