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
+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`)