File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -671,12 +671,14 @@ describe('registration', () => {
671671 expect ( journal . entries . size ) . toBe ( 0 )
672672 } )
673673
674- it ( 'settles an inbox read whose notifier throws instead of rejecting ' , async ( ) => {
674+ it ( 'still claims the calls of an inbox read whose notifier throws' , async ( ) => {
675675 const sim = new FakeSim ( )
676+ const runner = new FakeRunner ( )
677+ runner . immediate = DONE
676678 const executor = new DesktopExecutor ( {
677679 client : sim . client ,
678680 journal : new MemoryJournal ( ) ,
679- runner : new FakeRunner ( ) ,
681+ runner,
680682 leaseRenewMs : 60_000 ,
681683 retryBaseMs : 5 ,
682684 onUnregistered : ( ) => { } ,
@@ -685,7 +687,10 @@ describe('registration', () => {
685687 } ,
686688 } )
687689
690+ sim . inbox = [ callItem ( 'call-1' , 'chat-a' ) ]
691+
688692 await expect ( executor . reconcile ( ) ) . resolves . toBeUndefined ( )
693+ await vi . waitFor ( ( ) => expect ( runner . started ) . toEqual ( [ 'call-1' ] ) )
689694 } )
690695
691696 it ( 'raises no approval from an inbox read that Sim answers after sign-out' , async ( ) => {
Original file line number Diff line number Diff line change @@ -638,4 +638,26 @@ describe('agent commands in tmux', () => {
638638 tmuxFake . gone . clear ( )
639639 }
640640 } )
641+
642+ it ( 'still stops at sign-out a run whose Sim terminal was closed' , async ( ) => {
643+ tmuxFake . on = true
644+ tmuxFake . statusPaths . clear ( )
645+ tmuxFake . stopped . length = 0
646+ try {
647+ const terminal = new TerminalService ( { loadCwd : ( ) => '/tmp' } )
648+ const { activeTerminalId } = terminal . start ( { cols : 80 , rows : 24 } )
649+ const first = await terminal . executeTool ( 'call-orphan' , 'run' , {
650+ command : 'sleep 600' ,
651+ waitSeconds : 1 ,
652+ } )
653+ expect ( first ) . toMatchObject ( { ok : true , result : { status : 'running' } } )
654+ terminal . closeTerminal ( activeTerminalId as string )
655+
656+ await terminal . stopAgentCommands ( )
657+
658+ expect ( tmuxFake . stopped ) . toEqual ( [ [ ...tmuxFake . statusPaths . keys ( ) ] [ 0 ] ] )
659+ } finally {
660+ tmuxFake . on = false
661+ }
662+ } )
641663} )
You can’t perform that action at this time.
0 commit comments