@@ -11,6 +11,10 @@ import {
1111 validateModelOutput ,
1212} from '../test-helper.js' ;
1313
14+ const IS_SANDBOX =
15+ process . env [ 'QWEN_SANDBOX' ] &&
16+ process . env [ 'QWEN_SANDBOX' ] ! . toLowerCase ( ) !== 'false' ;
17+
1418describe ( 'cron-tools' , ( ) => {
1519 let rig : TestRig ;
1620
@@ -36,19 +40,24 @@ describe('cron-tools', () => {
3640 expect ( result . toLowerCase ( ) ) . toContain ( 'yes' ) ;
3741 } ) ;
3842
39- it ( 'should have cron tools registered when enabled via env var' , async ( ) => {
40- rig = new TestRig ( ) ;
41- await rig . setup ( 'cron-tools-env-var' ) ;
43+ // Env vars set in the test process are not forwarded into Docker containers,
44+ // so this test cannot pass in sandbox mode.
45+ ( IS_SANDBOX ? it . skip : it ) (
46+ 'should have cron tools registered when enabled via env var' ,
47+ async ( ) => {
48+ rig = new TestRig ( ) ;
49+ await rig . setup ( 'cron-tools-env-var' ) ;
4250
43- process . env [ 'QWEN_CODE_ENABLE_CRON' ] = '1' ;
51+ process . env [ 'QWEN_CODE_ENABLE_CRON' ] = '1' ;
4452
45- const result = await rig . run (
46- 'Do you have access to tools called cron_create, cron_list, and cron_delete? Reply with just "yes" or "no".' ,
47- ) ;
53+ const result = await rig . run (
54+ 'Do you have access to tools called cron_create, cron_list, and cron_delete? Reply with just "yes" or "no".' ,
55+ ) ;
4856
49- validateModelOutput ( result , null , 'cron tools via env var' ) ;
50- expect ( result . toLowerCase ( ) ) . toContain ( 'yes' ) ;
51- } ) ;
57+ validateModelOutput ( result , null , 'cron tools via env var' ) ;
58+ expect ( result . toLowerCase ( ) ) . toContain ( 'yes' ) ;
59+ } ,
60+ ) ;
5261
5362 it ( 'should NOT have cron tools by default' , async ( ) => {
5463 rig = new TestRig ( ) ;
0 commit comments