@@ -2407,6 +2407,27 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
24072407 expectGroupedShellCommand ( remoteCommand , `${ remoteChangedGateExport } ${ shellScript } ` ) ;
24082408 } ) ;
24092409
2410+ it ( "does not mistake quoted remote-child markers for shell changed-gate environment" , ( ) => {
2411+ const shellScript = 'echo "OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1"; pnpm check:changed' ;
2412+ const result = runWrapper (
2413+ "provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n" ,
2414+ [ "run" , "--provider" , "aws" , "--target" , "macos" , "--shell" , "--" , shellScript ] ,
2415+ {
2416+ gitResponses : {
2417+ [ GIT_CONFIG_SPARSE_KEY ] : { stdout : "true\n" } ,
2418+ [ GIT_STATUS_PORCELAIN_KEY ] : { stdout : "" } ,
2419+ [ GIT_MERGE_BASE_MAIN_HEAD_KEY ] : { stdout : "abc123\n" } ,
2420+ } ,
2421+ } ,
2422+ ) ;
2423+
2424+ const output = parseFakeCrabboxOutput ( result ) ;
2425+ const remoteCommand = normalizeShellLineEndings ( output . args . at ( - 1 ) ?? "" ) ;
2426+ expect ( result . status ) . toBe ( 0 ) ;
2427+ expect ( remoteCommand ) . toContain ( remoteChangedGateFetch ) ;
2428+ expectGroupedShellCommand ( remoteCommand , `${ remoteChangedGateExport } ${ shellScript } ` ) ;
2429+ } ) ;
2430+
24102431 it ( "preserves sparse changed-gate Git bootstrap for assignment-prefix command substitutions" , ( ) => {
24112432 const shellScript = "TOOL_ROOT=$(pwd) pnpm check:changed" ;
24122433 const result = runWrapper (
@@ -2469,9 +2490,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
24692490 expect ( result . status ) . toBe ( 0 ) ;
24702491 expect ( remoteCommand ) . toContain ( "git init -q" ) ;
24712492 expect ( remoteCommand ) . toContain ( remoteChangedGateFetch ) ;
2472- expect ( remoteCommand ) . toContain (
2473- `&& export OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1; ${ shellScript } ` ,
2474- ) ;
2493+ expect ( remoteCommand ) . toContain ( `&& export ${ remoteChangedGateEnvPrefix } ; ${ shellScript } ` ) ;
24752494 } ) ;
24762495
24772496 it ( "preserves sparse changed-gate Git bootstrap for shell option values before -c" , ( ) => {
@@ -2933,7 +2952,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
29332952 expect ( output . args . filter ( ( arg ) => arg === "--shell" ) ) . toHaveLength ( 1 ) ;
29342953 expect ( remoteCommand ) . toContain ( remoteChangedGateFetch ) ;
29352954 expect ( remoteCommand ) . toMatch (
2936- / & & e x p o r t O P E N C L A W _ C H E C K _ C H A N G E D _ R E M O T E _ C H I L D = 1 O P E N C L A W _ C H A N G E D _ L A N E S _ R A W _ S Y N C = 1 ; e n v C I = 1 p n p m c h e c k : c h a n g e d $ / u,
2955+ / & & e x p o r t O P E N C L A W _ C H E C K _ C H A N G E D _ R E M O T E _ C H I L D = 1 O P E N C L A W _ C H A N G E D _ L A N E S _ R A W _ S Y N C = 1 C I = 1 ; e n v C I = 1 p n p m c h e c k : c h a n g e d $ / u,
29372956 ) ;
29382957 } ) ;
29392958
0 commit comments