fix(config): stop sisyphus-junior from inheriting UI-selected model

This commit is contained in:
YeonGyu-Kim
2026-02-06 17:44:47 +09:00
parent 3be722b3b1
commit 3a0d7e8dc3
4 changed files with 119 additions and 280 deletions
+60 -6
View File
@@ -23,12 +23,6 @@ beforeEach(() => {
oracle: { name: "oracle", prompt: "test", mode: "subagent" },
})
spyOn(sisyphusJunior, "createSisyphusJuniorAgentWithOverrides" as any).mockReturnValue({
name: "sisyphus-junior",
prompt: "test",
mode: "subagent",
})
spyOn(commandLoader, "loadUserCommands" as any).mockResolvedValue({})
spyOn(commandLoader, "loadProjectCommands" as any).mockResolvedValue({})
spyOn(commandLoader, "loadOpencodeGlobalCommands" as any).mockResolvedValue({})
@@ -105,6 +99,66 @@ afterEach(() => {
;(modelResolver.resolveModelWithFallback as any)?.mockRestore?.()
})
describe("Sisyphus-Junior model inheritance", () => {
test("does not inherit UI-selected model as system default", async () => {
// #given
const pluginConfig: OhMyOpenCodeConfig = {}
const config: Record<string, unknown> = {
model: "opencode/kimi-k2.5-free",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})
// #when
await handler(config)
// #then
const agentConfig = config.agent as Record<string, { model?: string }>
expect(agentConfig["sisyphus-junior"]?.model).toBe(
sisyphusJunior.SISYPHUS_JUNIOR_DEFAULTS.model
)
})
test("uses explicitly configured sisyphus-junior model", async () => {
// #given
const pluginConfig: OhMyOpenCodeConfig = {
agents: {
"sisyphus-junior": {
model: "openai/gpt-5.3-codex",
},
},
}
const config: Record<string, unknown> = {
model: "opencode/kimi-k2.5-free",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})
// #when
await handler(config)
// #then
const agentConfig = config.agent as Record<string, { model?: string }>
expect(agentConfig["sisyphus-junior"]?.model).toBe(
"openai/gpt-5.3-codex"
)
})
})
describe("Plan agent demote behavior", () => {
test("orders core agents as sisyphus -> hephaestus -> prometheus -> atlas", async () => {
// #given
+1 -1
View File
@@ -222,7 +222,7 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
agentConfig["sisyphus-junior"] = createSisyphusJuniorAgentWithOverrides(
pluginConfig.agents?.["sisyphus-junior"],
config.model as string | undefined
undefined
);
if (builderEnabled) {