Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/lib/src/core/templates-entrypoint/codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ else
mkdir -p "$(dirname "$CODEX_CONFIG_FILE")" || true
cat <<'EOF' > "$CODEX_CONFIG_FILE"
# docker-git codex config
model = "gpt-5.3-codex"
model = "gpt-5.4"
model_context_window = 1050000
model_auto_compact_token_limit = 945000
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"
personality = "pragmatic"

approval_policy = "never"
Expand Down Expand Up @@ -195,12 +198,9 @@ fi`

const escapeForDoubleQuotes = (value: string): string => {
const backslash = String.fromCodePoint(92)
const quote = String.fromCodePoint(34)
const escapedBackslash = `${backslash}${backslash}`
const escapedQuote = `${backslash}${quote}`
return value
.replaceAll(backslash, escapedBackslash)
.replaceAll(quote, escapedQuote)
.replaceAll(backslash, `${backslash}${backslash}`)
.replaceAll(String.fromCodePoint(34), `${backslash}${String.fromCodePoint(34)}`)
}

export const renderEntrypointCodexResumeHint = (config: TemplateConfig): string =>
Expand Down
15 changes: 9 additions & 6 deletions packages/lib/src/usecases/auth-sync-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ const JsonRecordFromStringSchema = Schema.parseJson(JsonRecordSchema)
const defaultEnvContents = "# docker-git env\n# KEY=value\n"
const codexConfigMarker = "# docker-git codex config"

// CHANGE: enable web search tool in default Codex config (top-level)
// WHY: avoid deprecated legacy flags and keep config minimal
// QUOTE(ТЗ): "да убери легаси"
// REF: user-request-2026-02-05-remove-legacy-web-search
// CHANGE: switch default model to gpt-5.4 and pin xhigh reasoning for default + plan mode
// WHY: keep plan mode aligned with development mode while preserving long-context defaults
// QUOTE(ТЗ): "Сделать plan mode тоже с xhigh режимом как и разработка по дефолту. Так же заменить модель на gpt-5.4"
// REF: github-issue-109
// SOURCE: n/a
// FORMAT THEOREM: ∀c: config(c) -> web_search(c)="live"
// FORMAT THEOREM: ∀c: config(c) -> model(c)="gpt-5.4" ∧ reasoning(c)=xhigh ∧ plan_reasoning(c)=xhigh
// PURITY: CORE
// EFFECT: n/a
// INVARIANT: default config stays deterministic
// COMPLEXITY: O(1)
export const defaultCodexConfig = [
"# docker-git codex config",
"model = \"gpt-5.3-codex\"",
"model = \"gpt-5.4\"",
"model_context_window = 1050000",
"model_auto_compact_token_limit = 945000",
"model_reasoning_effort = \"xhigh\"",
"plan_mode_reasoning_effort = \"xhigh\"",
"personality = \"pragmatic\"",
"",
"approval_policy = \"never\"",
Expand Down
57 changes: 57 additions & 0 deletions packages/lib/tests/usecases/auth-sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,63 @@ describe("syncGithubAuthKeys", () => {
expect(next).toBe(target)
})

it.effect("creates codex config with gpt-5.4 and long-context overrides", () =>
withTempDir((root) =>
Effect.gen(function*(_) {
const fs = yield* _(FileSystem.FileSystem)
const path = yield* _(Path.Path)
const codexDir = path.join(root, ".orch", "auth", "codex")
const configPath = path.join(codexDir, "config.toml")

yield* _(ensureCodexConfigFile(root, ".orch/auth/codex"))

const configText = yield* _(fs.readFileString(configPath))
expect(configText).toContain("model = \"gpt-5.4\"")
expect(configText).toContain("model_context_window = 1050000")
expect(configText).toContain("model_auto_compact_token_limit = 945000")
expect(configText).toContain("model_reasoning_effort = \"xhigh\"")
expect(configText).toContain("plan_mode_reasoning_effort = \"xhigh\"")
})
).pipe(Effect.provide(NodeContext.layer)))

it.effect("rewrites managed codex config to include gpt-5.4 and plan mode xhigh", () =>
withTempDir((root) =>
Effect.gen(function*(_) {
const fs = yield* _(FileSystem.FileSystem)
const path = yield* _(Path.Path)
const codexDir = path.join(root, ".orch", "auth", "codex")
const configPath = path.join(codexDir, "config.toml")
const legacyManagedConfig = [
"# docker-git codex config",
"model = \"gpt-5.3-codex\"",
"model_reasoning_effort = \"xhigh\"",
"personality = \"pragmatic\"",
"",
"approval_policy = \"never\"",
"sandbox_mode = \"danger-full-access\"",
"web_search = \"live\"",
"",
"[features]",
"shell_snapshot = true",
"multi_agent = true",
"apps = true",
"shell_tool = true",
""
].join("\n")

yield* _(fs.makeDirectory(codexDir, { recursive: true }))
yield* _(fs.writeFileString(configPath, legacyManagedConfig))
yield* _(ensureCodexConfigFile(root, ".orch/auth/codex"))

const next = yield* _(fs.readFileString(configPath))
expect(next).toContain("model = \"gpt-5.4\"")
expect(next).toContain("model_context_window = 1050000")
expect(next).toContain("model_auto_compact_token_limit = 945000")
expect(next).toContain("model_reasoning_effort = \"xhigh\"")
expect(next).toContain("plan_mode_reasoning_effort = \"xhigh\"")
})
).pipe(Effect.provide(NodeContext.layer)))

it.effect("ignores permission-denied codex config rewrites", () =>
withTempDir((root) =>
Effect.gen(function*(_) {
Expand Down