| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- {
- "version": 1,
- "caseName": "conversation-session-dynamic-workflow-gray-always-on-notify",
- "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-notify.test.ts",
- "fixtures": [
- {
- "id": "dwn-title",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_DWN_"]
- },
- "response": {
- "statusCode": 200,
- "text": "{\"title\":\"工作流通知 E2E\"}"
- }
- },
- {
- "id": "dwn-ok-notified",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_OK_RESULT"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_OK_DIGESTED 工作流已完成:三个文件都检查过了。"
- }
- },
- {
- "id": "dwn-fail-notified",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_FAIL_BOOM"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_FAIL_DIGESTED 工作流出错:清单缺失,需要修脚本。"
- }
- },
- {
- "id": "dwn-busy-notified",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_BUSY_RESULT"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_BUSY_DIGESTED 忙碌期间结束的工作流已完成。"
- }
- },
- {
- "id": "dwn-busy-hold",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "controlled-stream",
- "syntheticReason": "忙碌窗口需要主代理的一轮停在流中途,让 run 在这一轮进行中结束;由用例在断言后放行,不改变产品时序。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["E2E_DWN_BUSY_HOLD"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "releaseAfterChunks": 3,
- "chunks": [
- {
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-dwn-busy-hold\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWN_BUSY_\"}}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"HELD 这一轮答完了。\"}}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n",
- "offsetMs": 0
- },
- {
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
- "offsetMs": 0
- }
- ]
- }
- },
- {
- "id": "dwn-ok-skill",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_ok_skill"
- ],
- "lastUserMessageIncludes": ["E2E_DWN_OK_START"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_ok_skill",
- "name": "Skill",
- "input": {
- "skill": "dynamic-workflows"
- }
- }
- }
- },
- {
- "id": "dwn-ok-create",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_ok_create"
- ],
- "bodyIncludes": ["E2E_DWN_OK_START", "toolu_dwn_ok_skill"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_ok_create",
- "name": "CreateWorkflow",
- "input": {
- "name": "E2E 通知完成工作流",
- "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-ok\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nreturn { verdict: \"E2E_DWN_OK_RESULT\", checked: 3 };"
- }
- }
- }
- },
- {
- "id": "dwn-ok-created",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "bodyIncludes": ["E2E_DWN_OK_START", "toolu_dwn_ok_create"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_OK_STARTED 工作流已启动,结束时会通知我。"
- }
- },
- {
- "id": "dwn-fail-skill",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_fail_skill"
- ],
- "lastUserMessageIncludes": ["E2E_DWN_FAIL_START"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_fail_skill",
- "name": "Skill",
- "input": {
- "skill": "dynamic-workflows"
- }
- }
- }
- },
- {
- "id": "dwn-fail-create",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_fail_create"
- ],
- "bodyIncludes": ["E2E_DWN_FAIL_START", "toolu_dwn_fail_skill"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_fail_create",
- "name": "CreateWorkflow",
- "input": {
- "name": "E2E 通知出错工作流",
- "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-fail\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nthrow new Error(\"E2E_DWN_FAIL_BOOM 清单缺失\");"
- }
- }
- }
- },
- {
- "id": "dwn-fail-created",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "bodyIncludes": ["E2E_DWN_FAIL_START", "toolu_dwn_fail_create"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_FAIL_STARTED 工作流已启动,结束时会通知我。"
- }
- },
- {
- "id": "dwn-busy-skill",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_busy_skill"
- ],
- "lastUserMessageIncludes": ["E2E_DWN_BUSY_START"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_busy_skill",
- "name": "Skill",
- "input": {
- "skill": "dynamic-workflows"
- }
- }
- }
- },
- {
- "id": "dwn-busy-create",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_dwn_busy_create"
- ],
- "bodyIncludes": ["E2E_DWN_BUSY_START", "toolu_dwn_busy_skill"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_dwn_busy_create",
- "name": "CreateWorkflow",
- "input": {
- "name": "E2E 通知忙碌工作流",
- "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-busy\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nreturn \"E2E_DWN_BUSY_RESULT 忙碌期间完成。\";"
- }
- }
- }
- },
- {
- "id": "dwn-busy-created",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "bodyIncludes": ["E2E_DWN_BUSY_START", "toolu_dwn_busy_create"]
- },
- "response": {
- "statusCode": 200,
- "text": "E2E_DWN_BUSY_STARTED 工作流已启动,结束时会通知我。"
- }
- }
- ]
- }
|