fix(codex): hide opencode model summary
This commit is contained in:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user