test(plugin): remove unsafe test assertions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-12 14:22:30 +09:00
parent 0787867384
commit f05aeaa63a
10 changed files with 186 additions and 186 deletions
+98 -98
View File
@@ -46,36 +46,36 @@ beforeEach(async () => {
mock.restore()
configErrors.clearConfigLoadErrors()
spyOn(agents, "createBuiltinAgents" as any).mockResolvedValue({
spyOn(agents, testCoerce("createBuiltinAgents")).mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
oracle: { name: "oracle", prompt: "test", mode: "subagent" },
})
spyOn(commandLoader, "loadUserCommands" as any).mockResolvedValue({})
spyOn(commandLoader, "loadProjectCommands" as any).mockResolvedValue({})
spyOn(commandLoader, "loadOpencodeGlobalCommands" as any).mockResolvedValue({})
spyOn(commandLoader, "loadOpencodeProjectCommands" as any).mockResolvedValue({})
spyOn(commandLoader, testCoerce("loadUserCommands")).mockResolvedValue({})
spyOn(commandLoader, testCoerce("loadProjectCommands")).mockResolvedValue({})
spyOn(commandLoader, testCoerce("loadOpencodeGlobalCommands")).mockResolvedValue({})
spyOn(commandLoader, testCoerce("loadOpencodeProjectCommands")).mockResolvedValue({})
spyOn(builtinCommands, "loadBuiltinCommands" as any).mockReturnValue({})
spyOn(builtinCommands, testCoerce("loadBuiltinCommands")).mockReturnValue({})
spyOn(skillLoader, "loadUserSkills" as any).mockResolvedValue({})
spyOn(skillLoader, "loadProjectSkills" as any).mockResolvedValue({})
spyOn(skillLoader, "loadOpencodeGlobalSkills" as any).mockResolvedValue({})
spyOn(skillLoader, "loadOpencodeProjectSkills" as any).mockResolvedValue({})
spyOn(skillLoader, "discoverUserClaudeSkills" as any).mockResolvedValue([])
spyOn(skillLoader, "discoverProjectClaudeSkills" as any).mockResolvedValue([])
spyOn(skillLoader, "discoverOpencodeGlobalSkills" as any).mockResolvedValue([])
spyOn(skillLoader, "discoverOpencodeProjectSkills" as any).mockResolvedValue([])
spyOn(skillLoader, testCoerce("loadUserSkills")).mockResolvedValue({})
spyOn(skillLoader, testCoerce("loadProjectSkills")).mockResolvedValue({})
spyOn(skillLoader, testCoerce("loadOpencodeGlobalSkills")).mockResolvedValue({})
spyOn(skillLoader, testCoerce("loadOpencodeProjectSkills")).mockResolvedValue({})
spyOn(skillLoader, testCoerce("discoverUserClaudeSkills")).mockResolvedValue([])
spyOn(skillLoader, testCoerce("discoverProjectClaudeSkills")).mockResolvedValue([])
spyOn(skillLoader, testCoerce("discoverOpencodeGlobalSkills")).mockResolvedValue([])
spyOn(skillLoader, testCoerce("discoverOpencodeProjectSkills")).mockResolvedValue([])
spyOn(agentLoader, "loadUserAgents" as any).mockReturnValue({})
spyOn(agentLoader, "loadProjectAgents" as any).mockReturnValue({})
spyOn(agentLoader, "loadOpencodeGlobalAgents" as any).mockReturnValue({})
spyOn(agentLoader, "loadOpencodeProjectAgents" as any).mockReturnValue({})
spyOn(agentLoader, testCoerce("loadUserAgents")).mockReturnValue({})
spyOn(agentLoader, testCoerce("loadProjectAgents")).mockReturnValue({})
spyOn(agentLoader, testCoerce("loadOpencodeGlobalAgents")).mockReturnValue({})
spyOn(agentLoader, testCoerce("loadOpencodeProjectAgents")).mockReturnValue({})
spyOn(mcpLoader, "loadMcpConfigs" as any).mockResolvedValue({ servers: {} })
spyOn(mcpLoader, testCoerce("loadMcpConfigs")).mockResolvedValue({ servers: {} })
setAdditionalAllowedMcpEnvVarsSpy = spyOn(mcpLoader, "setAdditionalAllowedMcpEnvVars").mockImplementation(() => {})
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockResolvedValue({
spyOn(pluginLoader, testCoerce("loadAllPluginComponents")).mockResolvedValue({
commands: {},
skills: {},
agents: {},
@@ -85,54 +85,54 @@ beforeEach(async () => {
errors: [],
})
spyOn(mcpModule, "createBuiltinMcps" as any).mockReturnValue({})
spyOn(mcpModule, testCoerce("createBuiltinMcps")).mockReturnValue({})
spyOn(shared, "log" as any).mockImplementation(() => {})
spyOn(shared, "fetchAvailableModels" as any).mockResolvedValue(new Set(["anthropic/claude-opus-4-7"]))
spyOn(shared, "readConnectedProvidersCache" as any).mockReturnValue(null)
spyOn(shared, testCoerce("log")).mockImplementation(() => {})
spyOn(shared, testCoerce("fetchAvailableModels")).mockResolvedValue(new Set(["anthropic/claude-opus-4-7"]))
spyOn(shared, testCoerce("readConnectedProvidersCache")).mockReturnValue(null)
spyOn(configDir, "getOpenCodeConfigPaths" as any).mockReturnValue({
spyOn(configDir, testCoerce("getOpenCodeConfigPaths")).mockReturnValue({
global: "/tmp/.config/opencode",
project: "/tmp/.opencode",
})
spyOn(permissionCompat, "migrateAgentConfig" as any).mockImplementation((config: Record<string, unknown>) => config)
spyOn(permissionCompat, testCoerce("migrateAgentConfig")).mockImplementation((config: Record<string, unknown>) => config)
spyOn(modelResolver, "resolveModelWithFallback" as any).mockReturnValue({ model: "anthropic/claude-opus-4-7" })
spyOn(modelResolver, testCoerce("resolveModelWithFallback")).mockReturnValue({ model: "anthropic/claude-opus-4-7" })
;({ createConfigHandler } = await importFreshConfigHandlerModule())
})
afterEach(() => {
(agents.createBuiltinAgents as any)?.mockRestore?.()
;(sisyphusJunior.createSisyphusJuniorAgentWithOverrides as any)?.mockRestore?.()
;(commandLoader.loadUserCommands as any)?.mockRestore?.()
;(commandLoader.loadProjectCommands as any)?.mockRestore?.()
;(commandLoader.loadOpencodeGlobalCommands as any)?.mockRestore?.()
;(commandLoader.loadOpencodeProjectCommands as any)?.mockRestore?.()
;(builtinCommands.loadBuiltinCommands as any)?.mockRestore?.()
;(skillLoader.loadUserSkills as any)?.mockRestore?.()
;(skillLoader.loadProjectSkills as any)?.mockRestore?.()
;(skillLoader.loadOpencodeGlobalSkills as any)?.mockRestore?.()
;(skillLoader.loadOpencodeProjectSkills as any)?.mockRestore?.()
;(skillLoader.discoverUserClaudeSkills as any)?.mockRestore?.()
;(skillLoader.discoverProjectClaudeSkills as any)?.mockRestore?.()
;(skillLoader.discoverOpencodeGlobalSkills as any)?.mockRestore?.()
;(skillLoader.discoverOpencodeProjectSkills as any)?.mockRestore?.()
;(agentLoader.loadUserAgents as any)?.mockRestore?.()
;(agentLoader.loadProjectAgents as any)?.mockRestore?.()
;(agentLoader.loadOpencodeGlobalAgents as any)?.mockRestore?.()
;(agentLoader.loadOpencodeProjectAgents as any)?.mockRestore?.()
;(mcpLoader.loadMcpConfigs as any)?.mockRestore?.()
(testCoerce(agents.createBuiltinAgents))?.mockRestore?.()
;(testCoerce(sisyphusJunior.createSisyphusJuniorAgentWithOverrides))?.mockRestore?.()
;(testCoerce(commandLoader.loadUserCommands))?.mockRestore?.()
;(testCoerce(commandLoader.loadProjectCommands))?.mockRestore?.()
;(testCoerce(commandLoader.loadOpencodeGlobalCommands))?.mockRestore?.()
;(testCoerce(commandLoader.loadOpencodeProjectCommands))?.mockRestore?.()
;(testCoerce(builtinCommands.loadBuiltinCommands))?.mockRestore?.()
;(testCoerce(skillLoader.loadUserSkills))?.mockRestore?.()
;(testCoerce(skillLoader.loadProjectSkills))?.mockRestore?.()
;(testCoerce(skillLoader.loadOpencodeGlobalSkills))?.mockRestore?.()
;(testCoerce(skillLoader.loadOpencodeProjectSkills))?.mockRestore?.()
;(testCoerce(skillLoader.discoverUserClaudeSkills))?.mockRestore?.()
;(testCoerce(skillLoader.discoverProjectClaudeSkills))?.mockRestore?.()
;(testCoerce(skillLoader.discoverOpencodeGlobalSkills))?.mockRestore?.()
;(testCoerce(skillLoader.discoverOpencodeProjectSkills))?.mockRestore?.()
;(testCoerce(agentLoader.loadUserAgents))?.mockRestore?.()
;(testCoerce(agentLoader.loadProjectAgents))?.mockRestore?.()
;(testCoerce(agentLoader.loadOpencodeGlobalAgents))?.mockRestore?.()
;(testCoerce(agentLoader.loadOpencodeProjectAgents))?.mockRestore?.()
;(testCoerce(mcpLoader.loadMcpConfigs))?.mockRestore?.()
setAdditionalAllowedMcpEnvVarsSpy?.mockRestore()
;(pluginLoader.loadAllPluginComponents as any)?.mockRestore?.()
;(mcpModule.createBuiltinMcps as any)?.mockRestore?.()
;(shared.log as any)?.mockRestore?.()
;(shared.fetchAvailableModels as any)?.mockRestore?.()
;(shared.readConnectedProvidersCache as any)?.mockRestore?.()
;(configDir.getOpenCodeConfigPaths as any)?.mockRestore?.()
;(permissionCompat.migrateAgentConfig as any)?.mockRestore?.()
;(modelResolver.resolveModelWithFallback as any)?.mockRestore?.()
;(agentPriorityOrder.reorderAgentsByPriority as any)?.mockRestore?.()
;(testCoerce(pluginLoader.loadAllPluginComponents))?.mockRestore?.()
;(testCoerce(mcpModule.createBuiltinMcps))?.mockRestore?.()
;(testCoerce(shared.log))?.mockRestore?.()
;(testCoerce(shared.fetchAvailableModels))?.mockRestore?.()
;(testCoerce(shared.readConnectedProvidersCache))?.mockRestore?.()
;(testCoerce(configDir.getOpenCodeConfigPaths))?.mockRestore?.()
;(testCoerce(permissionCompat.migrateAgentConfig))?.mockRestore?.()
;(testCoerce(modelResolver.resolveModelWithFallback))?.mockRestore?.()
;(testCoerce(agentPriorityOrder.reorderAgentsByPriority))?.mockRestore?.()
configErrors.clearConfigLoadErrors()
mock.restore()
})
@@ -230,10 +230,10 @@ describe("MCP env allowlist initialization", () => {
describe("Plan agent demote behavior", () => {
test("orders core agents as sisyphus -> hephaestus -> prometheus -> atlas", async () => {
// #given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
@@ -275,17 +275,17 @@ describe("Plan agent demote behavior", () => {
test("assembles core agents first before priority reorder runs", async () => {
// #given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
oracle: { name: "oracle", prompt: "test", mode: "subagent" },
atlas: { name: "atlas", prompt: "test", mode: "primary" },
})
const reorderSpy = spyOn(agentPriorityOrder, "reorderAgentsByPriority") as any
const reorderSpy = testCoerce(spyOn(agentPriorityOrder, "reorderAgentsByPriority"))
const pluginConfig = createPluginConfig({
sisyphus_agent: {
planner_enabled: true,
@@ -321,9 +321,9 @@ describe("Plan agent demote behavior", () => {
test("backfills runtime core agent names when builtin configs omit name", async () => {
// #given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { prompt: "test", mode: "primary" },
hephaestus: { prompt: "test", mode: "primary" },
@@ -485,9 +485,9 @@ describe("Plan agent demote behavior", () => {
describe("Agent permission defaults", () => {
test("hephaestus should allow task", async () => {
// #given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
@@ -1054,7 +1054,7 @@ describe("Plan agent model inheritance from prometheus", () => {
test("plan agent inherits temperature, reasoningEffort, and other model settings from prometheus", async () => {
//#given - prometheus configured with category that has temperature and reasoningEffort
spyOn(shared, "resolveModelPipeline" as any).mockReturnValue({
spyOn(shared, testCoerce("resolveModelPipeline")).mockReturnValue({
model: "openai/gpt-5.4",
provenance: "override",
variant: "high",
@@ -1109,7 +1109,7 @@ describe("Plan agent model inheritance from prometheus", () => {
test("plan agent user override takes priority over prometheus inherited settings", async () => {
//#given - prometheus resolves to opus, but user has plan override for gpt-5.4
spyOn(shared, "resolveModelPipeline" as any).mockReturnValue({
spyOn(shared, testCoerce("resolveModelPipeline")).mockReturnValue({
model: "anthropic/claude-opus-4-7",
provenance: "provider-fallback",
variant: "max",
@@ -1152,7 +1152,7 @@ describe("Plan agent model inheritance from prometheus", () => {
test("plan agent does NOT inherit prompt, description, or color from prometheus", async () => {
//#given
spyOn(shared, "resolveModelPipeline" as any).mockReturnValue({
spyOn(shared, testCoerce("resolveModelPipeline")).mockReturnValue({
model: "anthropic/claude-opus-4-7",
provenance: "provider-fallback",
variant: "max",
@@ -1229,8 +1229,8 @@ describe("Deadlock prevention - fetchAvailableModels must not receive client", (
describe("config-handler plugin loading error boundary (#1559)", () => {
test("returns empty defaults when loadAllPluginComponents throws", async () => {
//#given
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
;(testCoerce(pluginLoader.loadAllPluginComponents)).mockRestore?.()
spyOn(pluginLoader, testCoerce("loadAllPluginComponents")).mockRejectedValue(new Error("crash"))
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-7",
@@ -1255,8 +1255,8 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
test("returns empty defaults when loadAllPluginComponents times out", async () => {
//#given
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockImplementation(
;(testCoerce(pluginLoader.loadAllPluginComponents)).mockRestore?.()
spyOn(pluginLoader, testCoerce("loadAllPluginComponents")).mockImplementation(
() => new Promise(() => {})
)
const pluginConfig = createPluginConfig({
@@ -1285,8 +1285,8 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
test("records a config load error when loadAllPluginComponents fails", async () => {
//#given
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
;(testCoerce(pluginLoader.loadAllPluginComponents)).mockRestore?.()
spyOn(pluginLoader, testCoerce("loadAllPluginComponents")).mockRejectedValue(new Error("crash"))
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-7",
@@ -1314,8 +1314,8 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
test("passes through plugin data on successful load (identity test)", async () => {
//#given
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockResolvedValue({
;(testCoerce(pluginLoader.loadAllPluginComponents)).mockRestore?.()
spyOn(pluginLoader, testCoerce("loadAllPluginComponents")).mockResolvedValue({
commands: { "test-cmd": { description: "test", template: "test" } },
skills: {},
agents: {},
@@ -1351,16 +1351,16 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
describe("command agent routing coherence", () => {
test("keeps start-work aligned with the exported Atlas list key opencode matches exactly", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
atlas: { name: "atlas", prompt: "test", mode: "primary" },
})
;(builtinCommands.loadBuiltinCommands as unknown as {
;(testCoerce<{
mockReturnValue: (value: Record<string, unknown>) => void
}).mockReturnValue({
}>(builtinCommands.loadBuiltinCommands)).mockReturnValue({
"start-work": {
name: "start-work",
description: "(builtin) Start work",
@@ -1404,9 +1404,9 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
test("denies todowrite and todoread for primary agents when task_system is enabled", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
@@ -1445,10 +1445,10 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
test("does not deny todowrite/todoread when task_system is disabled", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
@@ -1487,10 +1487,10 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
test("does not deny todowrite/todoread when task_system is undefined", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
})
@@ -1526,10 +1526,10 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
describe("disable_omo_env pass-through", () => {
test("passes disable_omo_env=true to createBuiltinAgents", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "without-env", mode: "primary" },
})
@@ -1563,10 +1563,10 @@ describe("disable_omo_env pass-through", () => {
test("passes disable_omo_env=false to createBuiltinAgents when omitted", async () => {
//#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
const createBuiltinAgentsMock = testCoerce<{
mockResolvedValue: (value: Record<string, unknown>) => void
mock: { calls: unknown[][] }
}
}>(agents.createBuiltinAgents)
createBuiltinAgentsMock.mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "with-env", mode: "primary" },
})
@@ -1600,14 +1600,14 @@ describe("disable_omo_env pass-through", () => {
describe("Agent merge priority — project-local overrides global", () => {
test("project-local Claude agent overrides global Claude agent with same name", async () => {
// #given — same agent name in both global (user) and project scopes
;(agentLoader.loadUserAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadUserAgents)).mockReturnValue({
"my-custom-agent": {
description: "(user) global version",
mode: "subagent",
prompt: "I am the global agent",
},
})
;(agentLoader.loadProjectAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadProjectAgents)).mockReturnValue({
"my-custom-agent": {
description: "(project) project version",
mode: "subagent",
@@ -1640,14 +1640,14 @@ describe("Agent merge priority — project-local overrides global", () => {
test("opencode project agent overrides opencode global agent with same name", async () => {
// #given — same agent name in opencode global vs opencode project
;(agentLoader.loadOpencodeGlobalAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadOpencodeGlobalAgents)).mockReturnValue({
"my-custom-agent": {
description: "(opencode) global version",
mode: "subagent",
prompt: "I am the opencode global agent",
},
})
;(agentLoader.loadOpencodeProjectAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadOpencodeProjectAgents)).mockReturnValue({
"my-custom-agent": {
description: "(opencode-project) project version",
mode: "subagent",
@@ -1680,14 +1680,14 @@ describe("Agent merge priority — project-local overrides global", () => {
test("project Claude agent overrides opencode global agent with same name", async () => {
// #given — project-scope Claude agent vs global-scope opencode agent
;(agentLoader.loadOpencodeGlobalAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadOpencodeGlobalAgents)).mockReturnValue({
"my-custom-agent": {
description: "(opencode) global version",
mode: "subagent",
prompt: "I am the opencode global agent",
},
})
;(agentLoader.loadProjectAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadProjectAgents)).mockReturnValue({
"my-custom-agent": {
description: "(project) project version",
mode: "subagent",
@@ -1720,7 +1720,7 @@ describe("Agent merge priority — project-local overrides global", () => {
test("plugin agents have lowest priority — overridden by all other sources", async () => {
// #given — same agent in plugin, global, and project scopes
;(pluginLoader.loadAllPluginComponents as any).mockResolvedValue({
;(testCoerce(pluginLoader.loadAllPluginComponents)).mockResolvedValue({
commands: {},
skills: {},
agents: {
@@ -1735,7 +1735,7 @@ describe("Agent merge priority — project-local overrides global", () => {
plugins: [],
errors: [],
})
;(agentLoader.loadUserAgents as any).mockReturnValue({
;(testCoerce(agentLoader.loadUserAgents)).mockReturnValue({
"my-custom-agent": {
description: "(user) global version",
mode: "subagent",