@@ -32,6 +32,7 @@ const AGENTS_DELETE_SHARED_WORKSPACE_DOCKER_E2E_PATH =
3232 "scripts/e2e/agents-delete-shared-workspace-docker.sh" ;
3333const OPENWEBUI_DOCKER_E2E_PATH = "scripts/e2e/openwebui-docker.sh" ;
3434const ONBOARD_DOCKER_E2E_PATH = "scripts/e2e/onboard-docker.sh" ;
35+ const ONBOARD_SCENARIO_PATH = "scripts/e2e/lib/onboard/scenario.sh" ;
3536const KITCHEN_SINK_PLUGIN_DOCKER_E2E_PATH = "scripts/e2e/kitchen-sink-plugin-docker.sh" ;
3637const KITCHEN_SINK_RPC_DOCKER_E2E_PATH = "scripts/e2e/kitchen-sink-rpc-docker.sh" ;
3738const CODEX_ON_DEMAND_DOCKER_E2E_PATH = "scripts/e2e/codex-on-demand-docker.sh" ;
@@ -127,6 +128,16 @@ function extractUpgradeSurvivorPayload(script: string) {
127128 }
128129 return quoted . slice ( 1 , - 1 ) . replaceAll ( `'"'"'` , "'" ) ;
129130}
131+
132+ // Prompt-driving scripts must consume public prompts in the order the CLI renders them.
133+ function expectOrderedScriptFragments ( script : string , fragments : readonly string [ ] ) : void {
134+ let offset = 0 ;
135+ for ( const fragment of fragments ) {
136+ const index = script . indexOf ( fragment , offset ) ;
137+ expect ( index , `missing ordered script fragment: ${ fragment } ` ) . toBeGreaterThanOrEqual ( offset ) ;
138+ offset = index + fragment . length ;
139+ }
140+ }
130141const BOUNDED_CLIENT_LOG_DOCKER_E2E_SCRIPTS = [
131142 "scripts/e2e/cron-mcp-cleanup-docker.sh" ,
132143 "scripts/e2e/mcp-channels-docker.sh" ,
@@ -2619,6 +2630,25 @@ docker_e2e_docker_run_cmd run demo
26192630 expect ( script ) . not . toContain ( '"$HOME/.openclaw/agents/main/agent/auth-profiles.json"' ) ;
26202631 } ) ;
26212632
2633+ it ( "keeps real-TTY onboarding drivers aligned with the first-agent prompt" , ( ) => {
2634+ expectOrderedScriptFragments ( readFileSync ( RELEASE_TYPED_ONBOARDING_SCENARIO_PATH , "utf8" ) , [
2635+ 'wait_for_log "Continue?"' ,
2636+ "send $'y\\r'" ,
2637+ 'wait_for_log "What should we call your first agent?"' ,
2638+ "send $'\\r'" ,
2639+ 'wait_for_log "to search"' ,
2640+ "send $'ollama\\r'" ,
2641+ ] ) ;
2642+ expectOrderedScriptFragments ( readFileSync ( ONBOARD_SCENARIO_PATH , "utf8" ) , [
2643+ 'wait_for_log "What should we call your first agent?"' ,
2644+ "send $'\\r'" ,
2645+ 'wait_for_log "How should I set things up?"' ,
2646+ "send $'\\r'" ,
2647+ 'wait_for_log "Use Current model?"' ,
2648+ "send $'\\r'" ,
2649+ ] ) ;
2650+ } ) ;
2651+
26222652 it ( "keeps append-only mock E2E state under per-run scratch roots" , ( ) => {
26232653 const scripts = [
26242654 {
0 commit comments