@@ -73,6 +73,63 @@ describe("syncGithubAuthKeys", () => {
7373 expect ( next ) . toBe ( target )
7474 } )
7575
76+ it . effect ( "creates codex config with gpt-5.4 and long-context overrides" , ( ) =>
77+ withTempDir ( ( root ) =>
78+ Effect . gen ( function * ( _ ) {
79+ const fs = yield * _ ( FileSystem . FileSystem )
80+ const path = yield * _ ( Path . Path )
81+ const codexDir = path . join ( root , ".orch" , "auth" , "codex" )
82+ const configPath = path . join ( codexDir , "config.toml" )
83+
84+ yield * _ ( ensureCodexConfigFile ( root , ".orch/auth/codex" ) )
85+
86+ const configText = yield * _ ( fs . readFileString ( configPath ) )
87+ expect ( configText ) . toContain ( "model = \"gpt-5.4\"" )
88+ expect ( configText ) . toContain ( "model_context_window = 1050000" )
89+ expect ( configText ) . toContain ( "model_auto_compact_token_limit = 945000" )
90+ expect ( configText ) . toContain ( "model_reasoning_effort = \"xhigh\"" )
91+ expect ( configText ) . toContain ( "plan_mode_reasoning_effort = \"xhigh\"" )
92+ } )
93+ ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
94+
95+ it . effect ( "rewrites managed codex config to include gpt-5.4 and plan mode xhigh" , ( ) =>
96+ withTempDir ( ( root ) =>
97+ Effect . gen ( function * ( _ ) {
98+ const fs = yield * _ ( FileSystem . FileSystem )
99+ const path = yield * _ ( Path . Path )
100+ const codexDir = path . join ( root , ".orch" , "auth" , "codex" )
101+ const configPath = path . join ( codexDir , "config.toml" )
102+ const legacyManagedConfig = [
103+ "# docker-git codex config" ,
104+ "model = \"gpt-5.3-codex\"" ,
105+ "model_reasoning_effort = \"xhigh\"" ,
106+ "personality = \"pragmatic\"" ,
107+ "" ,
108+ "approval_policy = \"never\"" ,
109+ "sandbox_mode = \"danger-full-access\"" ,
110+ "web_search = \"live\"" ,
111+ "" ,
112+ "[features]" ,
113+ "shell_snapshot = true" ,
114+ "multi_agent = true" ,
115+ "apps = true" ,
116+ "shell_tool = true" ,
117+ ""
118+ ] . join ( "\n" )
119+
120+ yield * _ ( fs . makeDirectory ( codexDir , { recursive : true } ) )
121+ yield * _ ( fs . writeFileString ( configPath , legacyManagedConfig ) )
122+ yield * _ ( ensureCodexConfigFile ( root , ".orch/auth/codex" ) )
123+
124+ const next = yield * _ ( fs . readFileString ( configPath ) )
125+ expect ( next ) . toContain ( "model = \"gpt-5.4\"" )
126+ expect ( next ) . toContain ( "model_context_window = 1050000" )
127+ expect ( next ) . toContain ( "model_auto_compact_token_limit = 945000" )
128+ expect ( next ) . toContain ( "model_reasoning_effort = \"xhigh\"" )
129+ expect ( next ) . toContain ( "plan_mode_reasoning_effort = \"xhigh\"" )
130+ } )
131+ ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
132+
76133 it . effect ( "ignores permission-denied codex config rewrites" , ( ) =>
77134 withTempDir ( ( root ) =>
78135 Effect . gen ( function * ( _ ) {
0 commit comments