diff --git a/src/agents/utils.test.ts b/src/agents/utils.test.ts index 2feb71216..fdee0a606 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() } }) diff --git a/src/plugin/ultrawork-model-override.test.ts b/src/plugin/ultrawork-model-override.test.ts index 4f167e963..cee2dd59b 100644 --- a/src/plugin/ultrawork-model-override.test.ts +++ b/src/plugin/ultrawork-model-override.test.ts @@ -308,7 +308,10 @@ describe("applyUltraworkModelOverrideOnMessage", () => { //#then expect(output.message.model).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6" }) expect(output.message["variant"]).toBe("max") - expect(output.message["thinking"]).toBe("max") + expect(output.message["thinking"]).toEqual({ + type: "enabled", + budgetTokens: 16000, + }) expect(dbOverrideSpy).not.toHaveBeenCalled() }) @@ -324,7 +327,10 @@ describe("applyUltraworkModelOverrideOnMessage", () => { //#then expect(output.message.model).toBeUndefined() expect(output.message["variant"]).toBe("high") - expect(output.message["thinking"]).toBe("high") + expect(output.message["thinking"]).toEqual({ + type: "enabled", + budgetTokens: 16000, + }) expect(dbOverrideSpy).not.toHaveBeenCalled() }) diff --git a/src/plugin/ultrawork-model-override.ts b/src/plugin/ultrawork-model-override.ts index f6aa87bd2..7700f8274 100644 --- a/src/plugin/ultrawork-model-override.ts +++ b/src/plugin/ultrawork-model-override.ts @@ -8,6 +8,7 @@ import { scheduleDeferredModelOverride } from "./ultrawork-db-model-override" const CODE_BLOCK = /```[\s\S]*?```/g const INLINE_CODE = /`[^`]+`/g const ULTRAWORK_PATTERN = /\b(ultrawork|ulw)\b/i +const ULTRAWORK_THINKING_CONFIG = { type: "enabled", budgetTokens: 16000 } as const export function detectUltrawork(text: string): boolean { const clean = text.replace(CODE_BLOCK, "").replace(INLINE_CODE, "") @@ -117,7 +118,7 @@ export function applyUltraworkModelOverrideOnMessage( if (!override.providerID || !override.modelID) { if (override.variant) { output.message["variant"] = override.variant - output.message["thinking"] = override.variant + output.message["thinking"] = { ...ULTRAWORK_THINKING_CONFIG } } return } @@ -134,7 +135,7 @@ export function applyUltraworkModelOverrideOnMessage( output.message.model = targetModel if (override.variant) { output.message["variant"] = override.variant - output.message["thinking"] = override.variant + output.message["thinking"] = { ...ULTRAWORK_THINKING_CONFIG } } return }