{ "version": 1, "caseName": "conversation-session-dynamic-workflow-gray-always-on-run", "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-run.test.ts", "fixtures": [ { "id": "dwr-title", "metadata": { "kind": "common", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyExcludes": [], "bodyIncludes": ["Generate a concise title", "E2E_DWR_"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json; charset=utf-8" }, "body": "{\"id\":\"msg_upstream_e2e_text\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"工作流运行 E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}" } }, { "id": "dwr-agent-a", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定工作流子代理的回答;子代理会话、并行调度、阶段推进与结果回传仍走真实 run 引擎。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["You are a subagent inside a dynamic workflow run"], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent" ], "lastUserMessageIncludes": ["E2E_DWR_TASK_A"] }, "response": { "statusCode": 200, "text": "E2E_DWR_ANSWER_A 第一份材料结论成立。" } }, { "id": "dwr-agent-b", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定工作流子代理的回答;子代理会话、并行调度、阶段推进与结果回传仍走真实 run 引擎。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["You are a subagent inside a dynamic workflow run"], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent" ], "lastUserMessageIncludes": ["E2E_DWR_TASK_B"] }, "response": { "statusCode": 200, "text": "E2E_DWR_ANSWER_B 第二份材料结论成立。" } }, { "id": "dwr-agent-c", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "controlled-stream", "syntheticReason": "第二阶段子代理的回答以门闩挂起,在运行态断言完成后由测试显式释放,不依赖固定响应延时。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["You are a subagent inside a dynamic workflow run"], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent" ], "lastUserMessageIncludes": ["E2E_DWR_TASK_C"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream; charset=utf-8" }, "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwr_agent_c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWR_ANSWER_C 两份结论一致,可以合并。\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":32}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "chunks": [ { "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwr_agent_c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\n", "delayMs": 0 }, { "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n", "delayMs": 0 }, { "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWR_ANSWER_C 两份结论一致,可以合并。\"}}\n\n", "delayMs": 0 }, { "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n", "delayMs": 0 }, { "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":32}}\n\n", "delayMs": 0 }, { "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "delayMs": 0 } ], "releaseAfterChunks": 2 }, "maxMatches": 1 }, { "id": "dwr-skill", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent", "You are a subagent inside a dynamic workflow run", "toolu_dwr_skill" ], "lastUserMessageIncludes": ["E2E_DWR_START"] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_dwr_skill", "name": "Skill", "input": { "skill": "dynamic-workflows" } } } }, { "id": "dwr-create", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent", "You are a subagent inside a dynamic workflow run", "toolu_dwr_create" ], "bodyIncludes": ["E2E_DWR_START", "toolu_dwr_skill"] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_dwr_create", "name": "CreateWorkflow", "input": { "name": "E2E 调研汇总", "script": "phase(\"调研\");\nconst first = agent(\"调研员甲\").ask(\"E2E_DWR_TASK_A 调研第一份材料,给出一句结论。\");\nconst second = agent(\"调研员乙\").ask(\"E2E_DWR_TASK_B 调研第二份材料,给出一句结论。\");\n// 两份调研并行,汇总需要两份结论:这里是唯一的汇合点。\nconst [a, b] = await Promise.all([first, second]);\nphase(\"汇总\");\nconst summary = await agent(\"汇总员\").ask(`E2E_DWR_TASK_C 汇总两份结论:${a} / ${b}`);\nreturn { summary, parts: [a, b] };" } } } }, { "id": "dwr-notified", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent", "You are a subagent inside a dynamic workflow run" ], "bodyIncludes": ["E2E_DWR_START"], "lastUserMessageIncludes": ["", "completed"] }, "response": { "statusCode": 200, "text": "E2E_DWR_DONE 工作流已完成:两份材料结论一致。" } }, { "id": "dwr-created", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "You are now acting as the memory extraction subagent", "You are a subagent inside a dynamic workflow run" ], "bodyIncludes": ["E2E_DWR_START", "toolu_dwr_create"] }, "response": { "statusCode": 200, "text": "E2E_DWR_STARTED 工作流已启动,结果会以通知送达。" } } ] }