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
+4
View File
@@ -156,6 +156,10 @@ describe("runCliInstaller", () => {
expect(versionSpy).not.toHaveBeenCalled()
expect(addPluginSpy).not.toHaveBeenCalled()
expect(writeConfigSpy).not.toHaveBeenCalled()
const output = mockConsoleLog.mock.calls.map((call) => call.join(" ")).join("\n")
expect(output).not.toContain("Model Assignment")
expect(output).not.toContain("OpenAI/ChatGPT")
expect(output).not.toContain("Sisyphus agent performs best")
detectSpy.mockRestore()
installedSpy.mockRestore()
+2 -1
View File
@@ -116,7 +116,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete")
if (!config.hasClaude) {
if (config.hasOpenCode && !config.hasClaude) {
printInfo(
"Note: Sisyphus agent performs best with Claude Opus 4.5+. " +
"Other models work but may have reduced orchestration quality.",
@@ -124,6 +124,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi
}
if (
config.hasOpenCode &&
!config.hasClaude &&
!config.hasOpenAI &&
!config.hasGemini &&
@@ -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`)
+16
View File
@@ -179,4 +179,20 @@ describe("formatConfigSummary", () => {
expect(summary).toContain("Platform: both")
expect(summary).not.toContain("Codex Harness")
})
test("hides OpenCode model catalog for codex-only installs", () => {
// #given
const config = argsToConfig(createArgs({ platform: "codex", codexAutonomous: true }))
// #when
const summary = formatConfigSummary(config)
// #then
expect(summary).toContain("Platform: codex")
expect(summary).toContain("Codex autonomous mode: enabled")
expect(summary).not.toContain("Claude")
expect(summary).not.toContain("OpenAI/ChatGPT")
expect(summary).not.toContain("Model Assignment")
expect(summary).not.toContain("Models auto-configured")
})
})
+3
View File
@@ -36,6 +36,9 @@ export function formatConfigSummary(config: InstallConfig): string {
if (config.hasCodex) {
lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`)
}
if (!config.hasOpenCode) return lines.join("\n")
lines.push("")
const claudeDetail = config.hasClaude ? (config.isMax20 ? "max20" : "standard") : undefined
+10 -2
View File
@@ -96,14 +96,22 @@ export async function runTuiInstaller(args: InstallArgs, version: string): Promi
spinner.stop(`Config written to ${color.cyan(omoResult.configPath)}`)
}
if (!config.hasClaude) {
if (config.hasOpenCode && !config.hasClaude) {
p.log.info(
`${color.bold("Note:")} Sisyphus agent performs best with Claude Opus 4.5+.\n` +
`Other models work but may have reduced orchestration quality.`,
)
}
if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen && !config.hasVercelAiGateway) {
if (
config.hasOpenCode &&
!config.hasClaude &&
!config.hasOpenAI &&
!config.hasGemini &&
!config.hasCopilot &&
!config.hasOpencodeZen &&
!config.hasVercelAiGateway
) {
p.log.warn("No model providers configured. Using opencode/big-pickle as fallback.")
}