@@ -261,6 +261,83 @@ export function createE2ESuite(cfg: E2EConfig) {
261261 } ,
262262 120000
263263 ) ;
264+
265+ it . skipIf ( ! canRun ) (
266+ 'invoke maintains conversation continuity with session ID' ,
267+ async ( ) => {
268+ const sessionId = `e2e-session-${ randomUUID ( ) } ` ;
269+
270+ // First turn: say something memorable
271+ await retry (
272+ async ( ) => {
273+ const r1 = await run ( [
274+ 'invoke' ,
275+ '--prompt' ,
276+ 'Remember this word: pineapple' ,
277+ '--agent' ,
278+ agentName ,
279+ '--session-id' ,
280+ sessionId ,
281+ '--json' ,
282+ ] ) ;
283+ expect ( r1 . exitCode , `First turn failed (stdout: ${ r1 . stdout } , stderr: ${ r1 . stderr } )` ) . toBe ( 0 ) ;
284+ } ,
285+ 3 ,
286+ 10000
287+ ) ;
288+
289+ // Second turn: ask for it back
290+ const r2 = await run ( [
291+ 'invoke' ,
292+ '--prompt' ,
293+ 'What word did I ask you to remember?' ,
294+ '--agent' ,
295+ agentName ,
296+ '--session-id' ,
297+ sessionId ,
298+ '--json' ,
299+ ] ) ;
300+ expect ( r2 . exitCode , `Second turn failed: ${ r2 . stderr } ` ) . toBe ( 0 ) ;
301+
302+ const json = parseJsonOutput ( r2 . stdout ) as { success : boolean ; response ?: string } ;
303+ expect ( json . success ) . toBe ( true ) ;
304+ expect ( json . response ?. toLowerCase ( ) , 'Response should reference the word from the first turn' ) . toContain (
305+ 'pineapple'
306+ ) ;
307+ } ,
308+ 180000
309+ ) ;
310+
311+ it . skipIf ( ! canRun ) (
312+ 'invoke accepts a user ID' ,
313+ async ( ) => {
314+ const result = await run ( [
315+ 'invoke' ,
316+ '--prompt' ,
317+ 'Say hello' ,
318+ '--agent' ,
319+ agentName ,
320+ '--user-id' ,
321+ 'test-user-e2e' ,
322+ '--json' ,
323+ ] ) ;
324+
325+ expect ( result . exitCode , `Invoke with user-id failed: ${ result . stderr } ` ) . toBe ( 0 ) ;
326+ const json = parseJsonOutput ( result . stdout ) as { success : boolean } ;
327+ expect ( json . success ) . toBe ( true ) ;
328+ } ,
329+ 120000
330+ ) ;
331+
332+ it . skipIf ( ! canRun ) (
333+ 'deploy --plan succeeds without deploying' ,
334+ async ( ) => {
335+ const result = await run ( [ 'deploy' , '--plan' , '--json' ] ) ;
336+
337+ expect ( result . exitCode , `Deploy --plan failed: ${ result . stderr } ` ) . toBe ( 0 ) ;
338+ } ,
339+ 120000
340+ ) ;
264341 } ) ;
265342}
266343
0 commit comments