Skip to content

Commit ec93f85

Browse files
konardclaude
andcommitted
feat(config): add longcontx profile to codex config.toml
Move model_context_window and model_auto_compact_token_limit from the global section to a dedicated [profiles.longcontx] profile so that the large-context overrides only apply when the user explicitly selects `codex --profile longcontx`, instead of being forced on every model. - Resolves: #183 - INVARIANT: ∀c: default_config(c) → longcontx_profile(c) ∧ ¬global_context_override(c) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ef5a91e commit ec93f85

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ else
6565
cat <<'EOF' > "$CODEX_CONFIG_FILE"
6666
# docker-git codex config
6767
model = "gpt-5.4"
68-
model_context_window = 1050000
69-
model_auto_compact_token_limit = 945000
7068
model_reasoning_effort = "xhigh"
7169
plan_mode_reasoning_effort = "xhigh"
7270
personality = "pragmatic"
@@ -80,6 +78,13 @@ shell_snapshot = true
8078
multi_agent = true
8179
apps = true
8280
shell_tool = true
81+
82+
[profiles.longcontx]
83+
model = "gpt-5.4"
84+
model_context_window = 1050000
85+
model_auto_compact_token_limit = 945000
86+
model_reasoning_effort = "xhigh"
87+
plan_mode_reasoning_effort = "xhigh"
8388
EOF
8489
chown 1000:1000 "$CODEX_CONFIG_FILE" || true
8590
fi

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

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

32-
// CHANGE: switch default model to gpt-5.4 and pin xhigh reasoning for default + plan mode
33-
// WHY: keep plan mode aligned with development mode while preserving long-context defaults
34-
// QUOTE(ТЗ): "Сделать plan mode тоже с xhigh режимом как и разработка по дефолту. Так же заменить модель на gpt-5.4"
35-
// REF: github-issue-109
32+
// CHANGE: move model_context_window and model_auto_compact_token_limit to [profiles.longcontx]
33+
// WHY: global context window settings apply to all models; profile-scoped settings allow opt-in
34+
// QUOTE(ТЗ): "добавь longcontx"
35+
// REF: github-issue-183
3636
// SOURCE: n/a
37-
// FORMAT THEOREM: ∀c: config(c) -> model(c)="gpt-5.4" ∧ reasoning(c)=xhigh ∧ plan_reasoning(c)=xhigh
37+
// FORMAT THEOREM: ∀c: config(c) -> model(c)="gpt-5.4" ∧ reasoning(c)=xhigh ∧ longcontx_profile(c)=defined
3838
// PURITY: CORE
3939
// EFFECT: n/a
40-
// INVARIANT: default config stays deterministic
40+
// INVARIANT: default config stays deterministic; longcontx profile always present
4141
// COMPLEXITY: O(1)
4242
export const defaultCodexConfig = [
4343
"# docker-git codex config",
4444
"model = \"gpt-5.4\"",
45-
"model_context_window = 1050000",
46-
"model_auto_compact_token_limit = 945000",
4745
"model_reasoning_effort = \"xhigh\"",
4846
"plan_mode_reasoning_effort = \"xhigh\"",
4947
"personality = \"pragmatic\"",
@@ -56,7 +54,14 @@ export const defaultCodexConfig = [
5654
"shell_snapshot = true",
5755
"multi_agent = true",
5856
"apps = true",
59-
"shell_tool = true"
57+
"shell_tool = true",
58+
"",
59+
"[profiles.longcontx]",
60+
"model = \"gpt-5.4\"",
61+
"model_context_window = 1050000",
62+
"model_auto_compact_token_limit = 945000",
63+
"model_reasoning_effort = \"xhigh\"",
64+
"plan_mode_reasoning_effort = \"xhigh\""
6065
].join("\n")
6166

6267
export const resolvePathFromBase = (

0 commit comments

Comments
 (0)