Skip to content

Commit 2a57243

Browse files
committed
feat(codex): set gpt-5.4 defaults for plan mode and long context
- switch managed codex config model to gpt-5.4 - set plan_mode_reasoning_effort to xhigh - set model_context_window/model_auto_compact_token_limit defaults - add auth-sync tests for create/rewrite behavior Closes #109 Closes #111
1 parent 89ade10 commit 2a57243

File tree

3 files changed

+70
-7
lines changed

3 files changed

+70
-7
lines changed

packages/lib/src/core/templates-entrypoint/codex.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ else
6464
mkdir -p "$(dirname "$CODEX_CONFIG_FILE")" || true
6565
cat <<'EOF' > "$CODEX_CONFIG_FILE"
6666
# docker-git codex config
67-
model = "gpt-5.3-codex"
67+
model = "gpt-5.4"
68+
model_context_window = 1050000
69+
model_auto_compact_token_limit = 945000
6870
model_reasoning_effort = "xhigh"
71+
plan_mode_reasoning_effort = "xhigh"
6972
personality = "pragmatic"
7073
7174
approval_policy = "never"

packages/lib/src/usecases/auth-sync-helpers.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,23 @@ const JsonRecordFromStringSchema = Schema.parseJson(JsonRecordSchema)
2828
const defaultEnvContents = "# docker-git env\n# KEY=value\n"
2929
const codexConfigMarker = "# docker-git codex config"
3030

31-
// CHANGE: enable web search tool in default Codex config (top-level)
32-
// WHY: avoid deprecated legacy flags and keep config minimal
33-
// QUOTE(ТЗ): "да убери легаси"
34-
// REF: user-request-2026-02-05-remove-legacy-web-search
31+
// CHANGE: switch default model to gpt-5.4 and pin xhigh reasoning for default + plan mode
32+
// WHY: keep plan mode aligned with development mode while preserving long-context defaults
33+
// QUOTE(ТЗ): "Сделать plan mode тоже с xhigh режимом как и разработка по дефолту. Так же заменить модель на gpt-5.4"
34+
// REF: github-issue-109
3535
// SOURCE: n/a
36-
// FORMAT THEOREM: ∀c: config(c) -> web_search(c)="live"
36+
// FORMAT THEOREM: ∀c: config(c) -> model(c)="gpt-5.4" ∧ reasoning(c)=xhigh ∧ plan_reasoning(c)=xhigh
3737
// PURITY: CORE
3838
// EFFECT: n/a
3939
// INVARIANT: default config stays deterministic
4040
// COMPLEXITY: O(1)
4141
export const defaultCodexConfig = [
4242
"# docker-git codex config",
43-
"model = \"gpt-5.3-codex\"",
43+
"model = \"gpt-5.4\"",
44+
"model_context_window = 1050000",
45+
"model_auto_compact_token_limit = 945000",
4446
"model_reasoning_effort = \"xhigh\"",
47+
"plan_mode_reasoning_effort = \"xhigh\"",
4548
"personality = \"pragmatic\"",
4649
"",
4750
"approval_policy = \"never\"",

packages/lib/tests/usecases/auth-sync.test.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)