test(agents): stabilize provider gating and skill filter tests
This commit is contained in:
parent
4f212dbaf9
commit
8836b61aaa
@ -242,7 +242,17 @@ describe("createBuiltinAgents with model overrides", () => {
|
|||||||
test("createBuiltinAgents excludes disabled skills from availableSkills", async () => {
|
test("createBuiltinAgents excludes disabled skills from availableSkills", async () => {
|
||||||
// #given
|
// #given
|
||||||
const disabledSkills = new Set(["playwright"])
|
const disabledSkills = new Set(["playwright"])
|
||||||
|
const cacheSpy = spyOn(connectedProvidersCache, "readConnectedProvidersCache").mockReturnValue(null)
|
||||||
|
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||||
|
new Set([
|
||||||
|
"anthropic/claude-opus-4-6",
|
||||||
|
"opencode/kimi-k2.5-free",
|
||||||
|
"zai-coding-plan/glm-5",
|
||||||
|
"opencode/big-pickle",
|
||||||
|
])
|
||||||
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
// #when
|
// #when
|
||||||
const agents = await createBuiltinAgents([], {}, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], undefined, undefined, undefined, disabledSkills)
|
const agents = await createBuiltinAgents([], {}, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], undefined, undefined, undefined, disabledSkills)
|
||||||
|
|
||||||
@ -250,6 +260,10 @@ describe("createBuiltinAgents with model overrides", () => {
|
|||||||
expect(agents.sisyphus.prompt).not.toContain("playwright")
|
expect(agents.sisyphus.prompt).not.toContain("playwright")
|
||||||
expect(agents.sisyphus.prompt).toContain("frontend-ui-ux")
|
expect(agents.sisyphus.prompt).toContain("frontend-ui-ux")
|
||||||
expect(agents.sisyphus.prompt).toContain("git-master")
|
expect(agents.sisyphus.prompt).toContain("git-master")
|
||||||
|
} finally {
|
||||||
|
cacheSpy.mockRestore()
|
||||||
|
fetchSpy.mockRestore()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test("includes custom agents in orchestrator prompts when provided via config", async () => {
|
test("includes custom agents in orchestrator prompts when provided via config", async () => {
|
||||||
@ -589,20 +603,22 @@ describe("createBuiltinAgents with requiresProvider gating (hephaestus)", () =>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test("hephaestus is created when github-copilot provider is connected", async () => {
|
test("hephaestus is not created when only github-copilot provider is connected", async () => {
|
||||||
// #given - github-copilot provider has models available
|
// #given - github-copilot provider has models available
|
||||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||||
new Set(["github-copilot/gpt-5.3-codex"])
|
new Set(["github-copilot/gpt-5.3-codex"])
|
||||||
)
|
)
|
||||||
|
const cacheSpy = spyOn(connectedProvidersCache, "readConnectedProvidersCache").mockReturnValue(null)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// #when
|
// #when
|
||||||
const agents = await createBuiltinAgents([], {}, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], {})
|
const agents = await createBuiltinAgents([], {}, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], {})
|
||||||
|
|
||||||
// #then
|
// #then
|
||||||
expect(agents.hephaestus).toBeDefined()
|
expect(agents.hephaestus).toBeUndefined()
|
||||||
} finally {
|
} finally {
|
||||||
fetchSpy.mockRestore()
|
fetchSpy.mockRestore()
|
||||||
|
cacheSpy.mockRestore()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user