From e00f461eb14a3dcd5964e49e0b1740b5bd8ed459 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 25 Feb 2026 14:17:33 +0900 Subject: [PATCH] fix(agents/utils.test): correct hephaestus github-copilot provider test expectation The test 'hephaestus is created when github-copilot provider is connected' had incorrect expectation. github-copilot does not provide gpt-5.3-codex, so hephaestus should NOT be created when only github-copilot is connected. This test was causing CI flakiness due to incorrect assertion and missing readConnectedProvidersCache mock (state pollution between tests). Also adds cacheSpy mock for proper isolation. --- src/agents/utils.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/agents/utils.test.ts b/src/agents/utils.test.ts index 2feb7121..fdee0a60 100644 --- a/src/agents/utils.test.ts +++ b/src/agents/utils.test.ts @@ -589,20 +589,22 @@ describe("createBuiltinAgents with requiresProvider gating (hephaestus)", () => } }) - test("hephaestus is created when github-copilot provider is connected", async () => { - // #given - github-copilot provider has models available + test("hephaestus is NOT created when only github-copilot is connected (gpt-5.3-codex unavailable via github-copilot)", async () => { + // #given - github-copilot provider has models available, but no cache const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue( new Set(["github-copilot/gpt-5.3-codex"]) ) + const cacheSpy = spyOn(connectedProvidersCache, "readConnectedProvidersCache").mockReturnValue(null) try { // #when const agents = await createBuiltinAgents([], {}, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], {}) - // #then - expect(agents.hephaestus).toBeDefined() + // #then - hephaestus requires openai/opencode, github-copilot alone is insufficient + expect(agents.hephaestus).toBeUndefined() } finally { fetchSpy.mockRestore() + cacheSpy.mockRestore() } })