@@ -157,8 +157,8 @@ export class WorkflowRunner {
157157 // If in waiting state, let the provider's listener handle it
158158 // The provider will return __SWITCH_TO_AUTO__ or __SWITCH_TO_MANUAL__
159159 // and handleWaiting() will call setAutoMode()
160- if ( this . machine . state === 'waiting ' ) {
161- debug ( '[Runner] In waiting state, provider will handle mode switch' ) ;
160+ if ( this . machine . state === 'awaiting ' ) {
161+ debug ( '[Runner] In awaiting state, provider will handle mode switch' ) ;
162162 return ;
163163 }
164164 // In other states (running, idle), set auto mode directly
@@ -200,7 +200,7 @@ export class WorkflowRunner {
200200
201201 if ( state === 'running' ) {
202202 await this . executeCurrentStep ( ) ;
203- } else if ( state === 'waiting ' ) {
203+ } else if ( state === 'awaiting ' ) {
204204 await this . handleWaiting ( ) ;
205205 }
206206 }
@@ -247,7 +247,7 @@ export class WorkflowRunner {
247247 this . emitter . registerMonitoringId ( uniqueAgentId , stepData . monitoringId ) ;
248248 }
249249
250- this . emitter . updateAgentStatus ( uniqueAgentId , 'checkpoint ' ) ;
250+ this . emitter . updateAgentStatus ( uniqueAgentId , 'awaiting ' ) ;
251251 this . emitter . logMessage ( uniqueAgentId , '═' . repeat ( 80 ) ) ;
252252 this . emitter . logMessage ( uniqueAgentId , `${ step . agentName } resumed - waiting for input.` ) ;
253253
@@ -347,7 +347,7 @@ export class WorkflowRunner {
347347 // In auto mode, keep status as 'running' - controller will run next
348348 // In manual mode, show checkpoint - waiting for user input
349349 if ( ! this . machine . context . autoMode ) {
350- this . emitter . updateAgentStatus ( uniqueAgentId , 'checkpoint ' ) ;
350+ this . emitter . updateAgentStatus ( uniqueAgentId , 'awaiting ' ) ;
351351 debug ( '[Runner] Agent at checkpoint, waiting for user input' ) ;
352352 } else {
353353 debug ( '[Runner] Auto mode - keeping status as running for controller' ) ;
@@ -387,6 +387,18 @@ export class WorkflowRunner {
387387 debug ( '[Runner] Handling waiting state, autoMode=%s, promptQueue=%d items, queueIndex=%d' ,
388388 ctx . autoMode , ctx . promptQueue . length , ctx . promptQueueIndex ) ;
389389
390+ // No chained prompts - auto-advance to next step
391+ if ( ctx . promptQueue . length === 0 ) {
392+ debug ( '[Runner] No chained prompts, auto-advancing to next step' ) ;
393+ const step = this . moduleSteps [ ctx . currentStepIndex ] ;
394+ const uniqueAgentId = `${ step . agentId } -step-${ ctx . currentStepIndex } ` ;
395+ this . emitter . logMessage ( uniqueAgentId , `${ step . agentName } has completed their work.` ) ;
396+ this . emitter . logMessage ( uniqueAgentId , '\n' + '═' . repeat ( 80 ) + '\n' ) ;
397+ await markStepCompleted ( this . cmRoot , ctx . currentStepIndex ) ;
398+ this . machine . send ( { type : 'INPUT_RECEIVED' , input : '' } ) ;
399+ return ;
400+ }
401+
390402 // Build input context
391403 const inputContext : InputContext = {
392404 stepOutput : ctx . currentOutput ?? { output : '' } ,
@@ -409,7 +421,7 @@ export class WorkflowRunner {
409421 // Now show checkpoint since we're waiting for user input
410422 const step = this . moduleSteps [ ctx . currentStepIndex ] ;
411423 const uniqueAgentId = `${ step . agentId } -step-${ ctx . currentStepIndex } ` ;
412- this . emitter . updateAgentStatus ( uniqueAgentId , 'checkpoint ' ) ;
424+ this . emitter . updateAgentStatus ( uniqueAgentId , 'awaiting ' ) ;
413425 // Re-run waiting with user input
414426 return ;
415427 }
@@ -536,7 +548,7 @@ export class WorkflowRunner {
536548 ctx . currentMonitoringId = output . monitoringId ;
537549
538550 // Back to checkpoint while waiting for next input
539- this . emitter . updateAgentStatus ( uniqueAgentId , 'checkpoint ' ) ;
551+ this . emitter . updateAgentStatus ( uniqueAgentId , 'awaiting ' ) ;
540552
541553 // Stay in waiting state - will get more input
542554 // (The waiting handler will be called again)
@@ -545,7 +557,7 @@ export class WorkflowRunner {
545557 // Handle mode switch during execution
546558 if ( modeSwitchRequested ) {
547559 debug ( '[Runner] Step aborted due to mode switch to %s' , modeSwitchRequested ) ;
548- this . emitter . updateAgentStatus ( uniqueAgentId , 'checkpoint ' ) ;
560+ this . emitter . updateAgentStatus ( uniqueAgentId , 'awaiting ' ) ;
549561 await this . setAutoMode ( modeSwitchRequested === 'auto' ) ;
550562 }
551563 // Behavior (pause) already handled everything else
0 commit comments