conversation-session-v4-background-work.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-background-work",
  4. "spec": "./test/e2e/conversation-session/conversation-session-v4-background-work.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-background-work-title",
  8. "description": "E2E_V4_BGWORK 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_V4_BGWORK 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_V4_BGWORK"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "v4-background-work-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"V4 Background Work E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "v4-bgwork-toolcall",
  35. "description": "M4 cancelBackgroundWork 门禁:首轮返回 run_in_background 的 Bash tool_use(长 sleep),形成可取消的后台工作。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "fast-text",
  39. "source": "synthetic",
  40. "syntheticReason": "需要稳定产出一个 run_in_background 的后台 bash 任务以断言后台工作面板 + 取消。"
  41. },
  42. "maxMatches": 1,
  43. "match": {
  44. "method": "POST",
  45. "pathIncludes": "/messages",
  46. "lastUserMessageIncludes": ["E2E_V4_BGWORK"],
  47. "bodyExcludes": [
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY",
  50. "Command running in background"
  51. ]
  52. },
  53. "response": {
  54. "statusCode": 200,
  55. "statusMessage": "OK",
  56. "headers": {
  57. "cache-control": "no-cache",
  58. "content-type": "text/event-stream; charset=utf-8"
  59. },
  60. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-bgwork-toolcall\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":96,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_v4_bgwork\",\"name\":\"Bash\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"command\\\":\\\"sleep 300\\\",\\\"run_in_background\\\":true,\\\"description\\\":\\\"E2E_V4_BGWORK sleep\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":96,\"output_tokens\":24,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  61. }
  62. },
  63. {
  64. "id": "v4-bgwork-final",
  65. "description": "M4 后台任务 backgrounded 后的 tool_result 跟进回复(固定文本)。",
  66. "metadata": {
  67. "kind": "main",
  68. "timingPolicy": "fast-text",
  69. "source": "synthetic",
  70. "syntheticReason": "后台任务已分离,主轮只需固定收尾文本;核心断言在后台工作面板 + 取消。"
  71. },
  72. "maxMatches": 1,
  73. "match": {
  74. "method": "POST",
  75. "pathIncludes": "/messages",
  76. "bodyIncludes": ["E2E_V4_BGWORK", "Command running in background"],
  77. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  78. },
  79. "response": {
  80. "statusCode": 200,
  81. "text": {
  82. "id": "v4-bgwork-final",
  83. "inputTokens": 120,
  84. "outputTokens": 6,
  85. "text": "V4_BGWORK_STARTED_OK"
  86. }
  87. }
  88. }
  89. ]
  90. }