fix(codex): hide opencode model summary
This commit is contained in:
@@ -156,6 +156,10 @@ describe("runCliInstaller", () => {
|
|||||||
expect(versionSpy).not.toHaveBeenCalled()
|
expect(versionSpy).not.toHaveBeenCalled()
|
||||||
expect(addPluginSpy).not.toHaveBeenCalled()
|
expect(addPluginSpy).not.toHaveBeenCalled()
|
||||||
expect(writeConfigSpy).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()
|
detectSpy.mockRestore()
|
||||||
installedSpy.mockRestore()
|
installedSpy.mockRestore()
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi
|
|||||||
|
|
||||||
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete")
|
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete")
|
||||||
|
|
||||||
if (!config.hasClaude) {
|
if (config.hasOpenCode && !config.hasClaude) {
|
||||||
printInfo(
|
printInfo(
|
||||||
"Note: Sisyphus agent performs best with Claude Opus 4.5+. " +
|
"Note: Sisyphus agent performs best with Claude Opus 4.5+. " +
|
||||||
"Other models work but may have reduced orchestration quality.",
|
"Other models work but may have reduced orchestration quality.",
|
||||||
@@ -124,6 +124,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
config.hasOpenCode &&
|
||||||
!config.hasClaude &&
|
!config.hasClaude &&
|
||||||
!config.hasOpenAI &&
|
!config.hasOpenAI &&
|
||||||
!config.hasGemini &&
|
!config.hasGemini &&
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ describe("codex-config-toml", () => {
|
|||||||
"hide_world_writable_warning = false",
|
"hide_world_writable_warning = false",
|
||||||
"hide_rate_limit_model_nudge = true",
|
"hide_rate_limit_model_nudge = true",
|
||||||
"",
|
"",
|
||||||
|
"[windows]",
|
||||||
|
'sandbox = "elevated"',
|
||||||
|
"wsl2_proxy = true",
|
||||||
|
"",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -46,8 +50,11 @@ describe("codex-config-toml", () => {
|
|||||||
expect(content).toContain("hide_full_access_warning = true")
|
expect(content).toContain("hide_full_access_warning = true")
|
||||||
expect(content).toContain("hide_world_writable_warning = true")
|
expect(content).toContain("hide_world_writable_warning = true")
|
||||||
expect(content).toContain("hide_rate_limit_model_nudge = 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('approval_policy = "on-request"')
|
||||||
expect(content).not.toContain('sandbox_mode = "workspace-write"')
|
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 () => {
|
test("#given empty Codex config #when updating config #then enables MultiAgentV2 with ten thousand session threads", async () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { mkdir, readFile, writeFile } from "node:fs/promises"
|
import { mkdir, readFile, writeFile } from "node:fs/promises"
|
||||||
import { dirname } from "node:path"
|
import { dirname } from "node:path"
|
||||||
import { ensureCodexMultiAgentV2Config } from "./codex-multi-agent-v2-config"
|
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"
|
import type { CodexAgentConfig, CodexMarketplaceSource, TrustedHookState } from "./types"
|
||||||
|
|
||||||
const SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"] as const
|
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"))
|
let next = replaceOrInsertRootSetting(config, "approval_policy", JSON.stringify("never"))
|
||||||
next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"))
|
next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"))
|
||||||
next = replaceOrInsertRootSetting(next, "network_access", JSON.stringify("enabled"))
|
next = replaceOrInsertRootSetting(next, "network_access", JSON.stringify("enabled"))
|
||||||
|
next = removeWindowsSandboxSetting(next)
|
||||||
next = ensureNoticeEnabled(next, "hide_full_access_warning")
|
next = ensureNoticeEnabled(next, "hide_full_access_warning")
|
||||||
return ensureNoticeEnabled(next, "hide_world_writable_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 {
|
function ensureNoticeEnabled(config: string, key: string): string {
|
||||||
const section = findTomlSection(config, "notice")
|
const section = findTomlSection(config, "notice")
|
||||||
if (!section) return appendBlock(config, `[notice]\n${key} = true\n`)
|
if (!section) return appendBlock(config, `[notice]\n${key} = true\n`)
|
||||||
|
|||||||
@@ -179,4 +179,20 @@ describe("formatConfigSummary", () => {
|
|||||||
expect(summary).toContain("Platform: both")
|
expect(summary).toContain("Platform: both")
|
||||||
expect(summary).not.toContain("Codex Harness")
|
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")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ export function formatConfigSummary(config: InstallConfig): string {
|
|||||||
if (config.hasCodex) {
|
if (config.hasCodex) {
|
||||||
lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`)
|
lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config.hasOpenCode) return lines.join("\n")
|
||||||
|
|
||||||
lines.push("")
|
lines.push("")
|
||||||
|
|
||||||
const claudeDetail = config.hasClaude ? (config.isMax20 ? "max20" : "standard") : undefined
|
const claudeDetail = config.hasClaude ? (config.isMax20 ? "max20" : "standard") : undefined
|
||||||
|
|||||||
@@ -96,14 +96,22 @@ export async function runTuiInstaller(args: InstallArgs, version: string): Promi
|
|||||||
spinner.stop(`Config written to ${color.cyan(omoResult.configPath)}`)
|
spinner.stop(`Config written to ${color.cyan(omoResult.configPath)}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.hasClaude) {
|
if (config.hasOpenCode && !config.hasClaude) {
|
||||||
p.log.info(
|
p.log.info(
|
||||||
`${color.bold("Note:")} Sisyphus agent performs best with Claude Opus 4.5+.\n` +
|
`${color.bold("Note:")} Sisyphus agent performs best with Claude Opus 4.5+.\n` +
|
||||||
`Other models work but may have reduced orchestration quality.`,
|
`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.")
|
p.log.warn("No model providers configured. Using opencode/big-pickle as fallback.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user