diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fake-agy.lua | 11 | ||||
| -rw-r--r-- | tests/tui.exp | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/fake-agy.lua b/tests/fake-agy.lua index 4f76d8d..b1537ad 100644 --- a/tests/fake-agy.lua +++ b/tests/fake-agy.lua @@ -141,11 +141,20 @@ elseif resumed then local resumed_prompt=prompt('resume'); check_relay(); finish if current~='boundary workflow notice' then assert(text:find('[Assistant]: primary-tool-ok',1,true)) end if current=='branch-probe' then finish(q,'branch-seed-ok'); finish(prompt('warm-probe'),'warm-after-seed-ok') + local esc=prompt('esc-probe') + send({method='session/update',params={sessionId='test-session',update={ + sessionUpdate='agent_message_chunk',content={type='text',text='esc-window-open'}, + }}}) + local cancel=request('session/cancel'); assert(cancel.id==nil and cancel.params.sessionId=='test-session') + reply(esc,{stopReason='cancelled'}) + finish(prompt('after-esc-probe'),'after-esc-ok') reply(prompt('cancel-probe'),{stopReason='cancelled'}) elseif current=='boundary workflow notice' then assert(text:find('[User]: boundary steer',1,true) and text:find('[Tool result',1,true)); finish(q,'proceed-recovered-ok') else - assert(current=='cold-probe' and text:find('[Assistant]: warm-after-seed-ok',1,true)); finish(q,'cold-resume-ok') + assert(current=='cold-probe' and text:find('[Assistant]: warm-after-seed-ok',1,true) + and text:find('[User]: esc-probe',1,true) and not text:find('esc-window-open',1,true) + and text:find('[Assistant]: after-esc-ok',1,true)); finish(q,'cold-resume-ok') end else q = prompt('hello') diff --git a/tests/tui.exp b/tests/tui.exp index 77d3537..fdbad27 100644 --- a/tests/tui.exp +++ b/tests/tui.exp @@ -36,6 +36,9 @@ send -- "primary-tool-ok"; after 150; send -- "\r"; see {branched from} foreach {query answer} {branch-probe branch-seed-ok warm-probe warm-after-seed-ok} { send -- $query; see $query; send -- "\r"; see $answer } +send -- "esc-probe"; see {esc-probe}; send -- "\r"; see {esc-window-open} +send -- "\033"; see {\[interrupted\]} +send -- "after-esc-probe"; see {after-esc-probe}; send -- "\r"; see {after-esc-ok} # The installed module's longer path can wrap the error across terminal rows. send -- "cancel-probe"; see {cancel-probe}; send -- "\r"; see {stopped:}; see {cancelled} send -- "\003"; expect eof; wait |
