fix(codex): hide opencode model summary

This commit is contained in:
YeonGyu-Kim
2026-05-31 05:09:50 +09:00
parent 799a17bc2e
commit dc6cf852ea
7 changed files with 50 additions and 4 deletions
@@ -24,6 +24,10 @@ describe("codex-config-toml", () => {
"hide_world_writable_warning = false",
"hide_rate_limit_model_nudge = true",
"",
"[windows]",
'sandbox = "elevated"',
"wsl2_proxy = true",
"",
].join("\n"),
)
@@ -46,8 +50,11 @@ describe("codex-config-toml", () => {
expect(content).toContain("hide_full_access_warning = true")
expect(content).toContain("hide_world_writable_warning = true")
expect(content).toContain("hide_rate_limit_model_nudge = true")
expect(content).toContain("[windows]")
expect(content).toContain("wsl2_proxy = true")
expect(content).not.toContain('approval_policy = "on-request"')
expect(content).not.toContain('sandbox_mode = "workspace-write"')
expect(content).not.toContain('sandbox = "elevated"')
})
test("#given empty Codex config #when updating config #then enables MultiAgentV2 with ten thousand session threads", async () => {
+8 -1
View File
@@ -1,7 +1,7 @@
import { mkdir, readFile, writeFile } from "node:fs/promises"
import { dirname } from "node:path"
import { ensureCodexMultiAgentV2Config } from "./codex-multi-agent-v2-config"
import { appendBlock, findTomlSection, replaceOrInsertSetting } from "./toml-section-editor"
import { appendBlock, findTomlSection, removeSetting, replaceOrInsertSetting } from "./toml-section-editor"
import type { CodexAgentConfig, CodexMarketplaceSource, TrustedHookState } from "./types"
const SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"] as const
@@ -115,10 +115,17 @@ function ensureAutonomousPermissions(config: string): string {
let next = replaceOrInsertRootSetting(config, "approval_policy", JSON.stringify("never"))
next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"))
next = replaceOrInsertRootSetting(next, "network_access", JSON.stringify("enabled"))
next = removeWindowsSandboxSetting(next)
next = ensureNoticeEnabled(next, "hide_full_access_warning")
return ensureNoticeEnabled(next, "hide_world_writable_warning")
}
function removeWindowsSandboxSetting(config: string): string {
const section = findTomlSection(config, "windows")
if (!section) return config
return removeSetting(config, section, "sandbox")
}
function ensureNoticeEnabled(config: string, key: string): string {
const section = findTomlSection(config, "notice")
if (!section) return appendBlock(config, `[notice]\n${key} = true\n`)