@@ -491,9 +491,9 @@ async function followRun(workflowId: string, command: Command): Promise<void> {
491491
492492/**
493493 * The selection a `--stop-after` run sends when the caller selected nothing: the stop block's
494- * whole output, so `blockOutputs` names the block the run stopped after and holds what it
495- * produced ( the run's `output` stays empty: no Response block ran). The block is sent as the
496- * executor compares names ({@link normalizeBlockName}), so a display name with a dot is not read
494+ * whole output, so `blockOutputs` (with `--follow`, the final frame's `output`) names the block
495+ * the run stopped after and holds what it produced ( no Response block ran). The block is sent as
496+ * the executor compares names ({@link normalizeBlockName}), so a display name with a dot is not read
497497 * as a path; an id is sent as it is.
498498 */
499499function stopBlockSelection (
@@ -541,6 +541,8 @@ function followOrDelegate(previous: ((args: unknown[]) => unknown) | null) {
541541 const selection = resolveWorkflowRunSelection ( initialFlags )
542542 if ( selection ) command . setOptionValue ( 'run' , selection )
543543 const flags = command . optsWithGlobals ( ) as Record < string , unknown >
544+ const stopBlock = stopBlockSelection ( selection , flags )
545+ if ( stopBlock ) command . setOptionValue ( 'selectOutput' , stopBlock )
544546
545547 if ( flags . follow !== true ) {
546548 // A queued run has produced nothing to select from, so the server would
@@ -563,8 +565,6 @@ function followOrDelegate(previous: ((args: unknown[]) => unknown) | null) {
563565 )
564566 }
565567 if ( flags . async !== true ) {
566- const stopBlock = stopBlockSelection ( selection , flags )
567- if ( stopBlock ) command . setOptionValue ( 'selectOutput' , stopBlock )
568568 await runWithResultStream ( workflowId , command , waitTimeoutSeconds )
569569 return
570570 }
0 commit comments