@@ -454,7 +454,7 @@ describe("openclaw launcher", () => {
454454
455455 const result = spawnSync (
456456 process . execPath ,
457- [ path . join ( fixtureRoot , "openclaw.mjs" ) , "--profile " , "work " , "--no-color" , "models" , "-h" ] ,
457+ [ path . join ( fixtureRoot , "openclaw.mjs" ) , "--log-level " , "warn " , "--no-color" , "models" , "-h" ] ,
458458 {
459459 cwd : fixtureRoot ,
460460 env : launcherEnv ( ) ,
@@ -466,6 +466,43 @@ describe("openclaw launcher", () => {
466466 expect ( result . stdout ) . toBe ( "PRECOMPUTED models help\n" ) ;
467467 } ) ;
468468
469+ it . each (
470+ [
471+ [ "--profile" , "work" , "nodes" , "--help" ] ,
472+ [ "--profile=work" , "nodes" , "--help" ] ,
473+ [ "--dev" , "nodes" , "--help" ] ,
474+ [ "--profile" , "default" , "models" , "--help" ] ,
475+ [ "--profile=" , "models" , "--help" ] ,
476+ [ "--profile" , "bad profile" , "models" , "--help" ] ,
477+ [ "--dev" , "--profile" , "work" , "models" , "--help" ] ,
478+ [ "--profile" , "work" , "--dev" , "models" , "--help" ] ,
479+ ] . map ( ( args ) => ( { args, invocation : args . join ( " " ) } ) ) ,
480+ ) ( "passes profile selection to the runtime before cached help: $invocation" , async ( { args } ) => {
481+ const fixtureRoot = await makeLauncherFixture ( fixtureRoots ) ;
482+ await fs . writeFile (
483+ path . join ( fixtureRoot , "dist" , "cli-startup-metadata.json" ) ,
484+ JSON . stringify ( {
485+ nodesHelpText : "PRECOMPUTED nodes help\n" ,
486+ subcommandHelpText : { models : "PRECOMPUTED models help\n" } ,
487+ } ) ,
488+ "utf8" ,
489+ ) ;
490+ await fs . writeFile (
491+ path . join ( fixtureRoot , "dist" , "entry.js" ) ,
492+ "process.stdout.write(JSON.stringify(process.argv.slice(2)));\n" ,
493+ "utf8" ,
494+ ) ;
495+
496+ const result = spawnSync ( process . execPath , [ path . join ( fixtureRoot , "openclaw.mjs" ) , ...args ] , {
497+ cwd : fixtureRoot ,
498+ env : launcherEnv ( ) ,
499+ encoding : "utf8" ,
500+ } ) ;
501+
502+ expect ( result . status ) . toBe ( 0 ) ;
503+ expect ( result . stdout ) . toBe ( JSON . stringify ( args ) ) ;
504+ } ) ;
505+
469506 it ( "defers precomputed subcommand help to the runtime entry when container env is set" , async ( ) => {
470507 const fixtureRoot = await makeLauncherFixture ( fixtureRoots ) ;
471508 await fs . writeFile (
0 commit comments