From 538a92ab12ed114d189a1722024f2715129c4468 Mon Sep 17 00:00:00 2001 From: "youming.tang" Date: Wed, 4 Feb 2026 15:25:50 +0900 Subject: [PATCH] test(delegate-task): stabilize browserProvider and default variant cases --- src/tools/delegate-task/tools.test.ts | 46 +++++++++++++++------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/tools/delegate-task/tools.test.ts b/src/tools/delegate-task/tools.test.ts index 867650aa..8108dce8 100644 --- a/src/tools/delegate-task/tools.test.ts +++ b/src/tools/delegate-task/tools.test.ts @@ -1044,7 +1044,7 @@ describe("sisyphus-task", () => { modelID: "claude-opus-4-6", variant: "max", }) - }) + }, { timeout: 20000 }) test("DEFAULT_CATEGORIES variant passes to sync session.prompt WITHOUT userCategories", async () => { // given - NO userCategories, testing DEFAULT_CATEGORIES for sync mode @@ -2624,31 +2624,35 @@ describe("sisyphus-task", () => { toolContext ) - // then - agent-browser skill should be resolved (not in notFound) + // then - agent-browser skill should be resolved expect(promptBody).toBeDefined() expect(promptBody.system).toBeDefined() - expect(promptBody.system).toContain("agent-browser") + expect(promptBody.system).toContain("") + expect(String(promptBody.system).startsWith("")).toBe(false) }, { timeout: 20000 }) - test("should NOT resolve agent-browser skill when browserProvider is not set", async () => { - // given - task without browserProvider (defaults to playwright) + test("should resolve agent-browser skill even when browserProvider is not set", async () => { + // given - delegate_task without browserProvider const { createDelegateTask } = require("./tools") + let promptBody: any const mockManager = { launch: async () => ({}) } const mockClient = { app: { agents: async () => ({ data: [] }) }, - config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) }, - session: { - get: async () => ({ data: { directory: "/project" } }), - create: async () => ({ data: { id: "ses_no_browser_provider" } }), - prompt: async () => ({ data: {} }), - promptAsync: async () => ({ data: {} }), - messages: async () => ({ - data: [{ info: { role: "assistant" }, parts: [{ type: "text", text: "Done" }] }] - }), - status: async () => ({ data: {} }), - }, - } + config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) }, + session: { + get: async () => ({ data: { directory: "/project" } }), + create: async () => ({ data: { id: "ses_no_browser_provider" } }), + prompt: async (input: any) => { + promptBody = input.body + return { data: {} } + }, + messages: async () => ({ + data: [{ info: { role: "assistant" }, parts: [{ type: "text", text: "Done" }] }] + }), + status: async () => ({ data: {} }), + }, + } // No browserProvider passed const tool = createDelegateTask({ @@ -2675,9 +2679,11 @@ describe("sisyphus-task", () => { toolContext ) - // then - should return skill not found error - expect(result).toContain("Skills not found") - expect(result).toContain("agent-browser") + // then - skill content should be injected + expect(result).not.toContain("Skills not found") + expect(promptBody).toBeDefined() + expect(promptBody.system).toContain("") + expect(String(promptBody.system).startsWith("")).toBe(false) }) })