@@ -22,7 +22,7 @@ fn decode_plan_to_wire(bytes: &[u8]) -> anyhow::Result<hm_pipeline_ir::PipelineG
2222/// the resulting plan does not decode, the Docker daemon is unreachable,
2323/// or the orchestrator surfaces an internal scheduler error. Non-zero
2424/// step exit codes are returned as the `i32`, not as an Err.
25- pub async fn handle ( args : RunArgs , _ctx : RunContext ) -> Result < i32 > {
25+ pub async fn handle ( args : RunArgs , ctx : RunContext ) -> Result < i32 > {
2626 let repo_root = match args. dir . clone ( ) {
2727 Some ( p) => p,
2828 None => std:: env:: current_dir ( ) . context ( "cannot determine current directory" ) ?,
@@ -68,9 +68,19 @@ pub async fn handle(args: RunArgs, _ctx: RunContext) -> Result<i32> {
6868 runner_registry. register ( Arc :: new ( DockerRunner ) , true ) ;
6969 let runner_registry = Arc :: new ( runner_registry) ;
7070
71+ let use_logs = args. logs || std:: env:: var_os ( "CI" ) . is_some_and ( |v| !v. is_empty ( ) ) ;
72+
7173 let renderer: Box < dyn crate :: runner:: OutputRenderer > = match args. format . as_str ( ) {
7274 "json" => Box :: new ( crate :: output:: json:: JsonRenderer :: new ( std:: io:: stdout ( ) ) ) ,
73- _ => Box :: new ( crate :: output:: human:: HumanRenderer :: new ( std:: io:: stderr ( ) ) ) ,
75+ "human" if use_logs => Box :: new ( crate :: output:: human:: HumanRenderer :: new (
76+ std:: io:: stderr ( ) ,
77+ ctx. output . color_enabled ( ) ,
78+ ) ) ,
79+ "human" => Box :: new ( crate :: output:: progress:: ProgressRenderer :: new (
80+ std:: io:: stderr ( ) ,
81+ ctx. output . color_enabled ( ) ,
82+ ) ) ,
83+ other => anyhow:: bail!( "unknown --format '{other}'\n available: human, json" ) ,
7484 } ;
7585
7686 let exit_code =
0 commit comments