@@ -360,13 +360,15 @@ describe("Codex ring-zero thread config", () => {
360360 dynamicTools : [ ] ,
361361 hostSystemAgentActive : true ,
362362 nativeCodeModeEnabled : false ,
363+ config : { project_doc_max_bytes : 64_000 } ,
363364 } ) ;
364365 const resume = buildThreadResumeParams ( params , {
365366 appServer,
366367 dynamicTools : [ ] ,
367368 hostSystemAgentActive : true ,
368369 nativeCodeModeEnabled : false ,
369370 threadId : "thread-1" ,
371+ config : { project_doc_max_bytes : 64_000 } ,
370372 } ) ;
371373
372374 expect ( start . environments ) . toEqual ( [ ] ) ;
@@ -1434,6 +1436,7 @@ describe("Codex app-server native code mode config", () => {
14341436 } ) ;
14351437
14361438 expect ( request . config ) . toEqual ( {
1439+ project_doc_max_bytes : 131_072 ,
14371440 "features.hooks" : true ,
14381441 apps : { _default : { enabled : false } } ,
14391442 mcp_servers : {
@@ -1588,6 +1591,7 @@ describe("Codex app-server native code mode config", () => {
15881591 ) ;
15891592
15901593 expect ( request . config ) . toEqual ( {
1594+ project_doc_max_bytes : 131_072 ,
15911595 "features.code_mode" : true ,
15921596 "features.code_mode_only" : false ,
15931597 "features.goals" : false ,
@@ -1717,6 +1721,7 @@ describe("Codex app-server native code mode config", () => {
17171721 } ) ;
17181722
17191723 expect ( request . config ) . toEqual ( {
1724+ project_doc_max_bytes : 131_072 ,
17201725 "features.code_mode" : true ,
17211726 "features.code_mode_only" : true ,
17221727 "features.goals" : false ,
@@ -1740,6 +1745,7 @@ describe("Codex app-server native code mode config", () => {
17401745 } ) ;
17411746
17421747 expect ( request . config ) . toEqual ( {
1748+ project_doc_max_bytes : 131_072 ,
17431749 "features.code_mode" : true ,
17441750 "features.code_mode_only" : true ,
17451751 "features.goals" : false ,
@@ -1799,6 +1805,7 @@ describe("Codex app-server native code mode config", () => {
17991805 } ) ;
18001806
18011807 expect ( request . config ) . toEqual ( {
1808+ project_doc_max_bytes : 131_072 ,
18021809 "features.code_mode" : true ,
18031810 "features.code_mode_only" : false ,
18041811 "features.goals" : false ,
@@ -1825,6 +1832,7 @@ describe("Codex app-server native code mode config", () => {
18251832 } ) ;
18261833
18271834 expect ( request . config ) . toEqual ( {
1835+ project_doc_max_bytes : 131_072 ,
18281836 "features.code_mode" : false ,
18291837 "features.code_mode_only" : false ,
18301838 "features.goals" : false ,
@@ -1846,6 +1854,7 @@ describe("Codex app-server native code mode config", () => {
18461854 } ) ;
18471855
18481856 expect ( request . config ) . toEqual ( {
1857+ project_doc_max_bytes : 131_072 ,
18491858 "features.code_mode" : false ,
18501859 "features.code_mode_only" : false ,
18511860 "features.goals" : false ,
@@ -1887,8 +1896,17 @@ describe("Codex app-server native code mode config", () => {
18871896 } ) ;
18881897 } ) ;
18891898
1890- it ( "keeps native Codex project docs enabled when context is not lightweight" , ( ) => {
1891- const request = buildThreadResumeParams (
1899+ it ( "defaults native Codex project docs to 128 KiB while honoring explicit overrides" , ( ) => {
1900+ const defaultRequest = buildThreadStartParams (
1901+ createAttemptParams ( { provider : "openai" , bootstrapContextRunKind : "cron" } ) ,
1902+ {
1903+ cwd : "/repo" ,
1904+ dynamicTools : [ ] ,
1905+ appServer : createAppServerOptions ( ) as never ,
1906+ developerInstructions : "test instructions" ,
1907+ } ,
1908+ ) ;
1909+ const overrideRequest = buildThreadResumeParams (
18921910 createAttemptParams ( { provider : "openai" , bootstrapContextRunKind : "cron" } ) ,
18931911 {
18941912 threadId : "thread-1" ,
@@ -1900,7 +1918,8 @@ describe("Codex app-server native code mode config", () => {
19001918 } ,
19011919 ) ;
19021920
1903- expect ( request . config ) . toEqual ( {
1921+ expect ( defaultRequest . config ?. project_doc_max_bytes ) . toBe ( 131_072 ) ;
1922+ expect ( overrideRequest . config ) . toEqual ( {
19041923 project_doc_max_bytes : 64_000 ,
19051924 "features.code_mode" : true ,
19061925 "features.code_mode_only" : false ,
@@ -2105,6 +2124,7 @@ describe("Codex app-server turn params", () => {
21052124 approvalPolicy : "on-request" ,
21062125 approvalsReviewer : "guardian_subagent" ,
21072126 config : {
2127+ project_doc_max_bytes : 131_072 ,
21082128 "features.code_mode" : true ,
21092129 "features.code_mode_only" : false ,
21102130 "features.goals" : false ,
@@ -3293,6 +3313,7 @@ describe("Codex app-server supervised branch lifecycle", () => {
32933313 excludeTurns : true ,
32943314 developerInstructions : agentWorkspaceDeveloperInstructions ,
32953315 config : {
3316+ project_doc_max_bytes : 131_072 ,
32963317 allow_login_shell : false ,
32973318 shell_environment_policy : {
32983319 experimental_use_profile : false ,
@@ -3312,6 +3333,7 @@ describe("Codex app-server supervised branch lifecycle", () => {
33123333 dynamicTools,
33133334 environments : [ { environmentId : "local" , cwd : workspaceDir } ] ,
33143335 config : {
3336+ project_doc_max_bytes : 131_072 ,
33153337 allow_login_shell : false ,
33163338 shell_environment_policy : {
33173339 experimental_use_profile : false ,
0 commit comments