conversation-session-running-actions.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-running-actions",
  4. "spec": "./test/e2e/conversation-session/execution/conversation-session-running-actions.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-running-actions-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy fixture 或触发后台网络重试。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-conversation-readonly-running-actions-final",
  31. "description": "running action guard 前置消息的 Read tool_result 后最终回复。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "该响应只需要稳定产出 completed assistant 历史,供后续 running 中 fork/edit guard 断言引用。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_RUNNING_ACTIONS_COMPLETED", "E2E_READONLY_TOOL_FILE_CONTENT"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "statusMessage": "OK",
  48. "headers": {
  49. "cache-control": "no-cache",
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-conversation-readonly-running-actions-final\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":190,\"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\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\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\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":190,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  53. }
  54. },
  55. {
  56. "id": "upstream-conversation-running-actions-active-slow-stream",
  57. "description": "running action guard 第二轮慢速流式响应,稳定制造 running 窗口。",
  58. "metadata": {
  59. "kind": "main",
  60. "timingPolicy": "controlled-stream",
  61. "source": "synthetic",
  62. "syntheticReason": "该 case 断言 running 中 fork/edit 入口状态,需要可控 streaming 窗口;真实模型可能过快完成。"
  63. },
  64. "maxMatches": 1,
  65. "match": {
  66. "method": "POST",
  67. "pathIncludes": "/messages",
  68. "lastUserMessageIncludes": ["E2E_RUNNING_ACTIONS_ACTIVE"],
  69. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_ACTIONS_ACTIVE"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "statusMessage": "OK",
  75. "headers": {
  76. "cache-control": "no-cache",
  77. "content-type": "text/event-stream; charset=utf-8"
  78. },
  79. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-conversation-running-actions-active-slow-stream\",\"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\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\":\"deep\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\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\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  80. "events": [
  81. {
  82. "sequence": 0,
  83. "offsetMs": 0,
  84. "byteLength": 369,
  85. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-conversation-running-actions-active-slow-stream\",\"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"
  86. },
  87. {
  88. "sequence": 1,
  89. "offsetMs": 250,
  90. "byteLength": 120,
  91. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  92. },
  93. {
  94. "sequence": 2,
  95. "offsetMs": 8000,
  96. "byteLength": 118,
  97. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  98. },
  99. {
  100. "sequence": 3,
  101. "offsetMs": 16000,
  102. "byteLength": 118,
  103. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  104. },
  105. {
  106. "sequence": 4,
  107. "offsetMs": 24000,
  108. "byteLength": 122,
  109. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  110. },
  111. {
  112. "sequence": 5,
  113. "offsetMs": 90000,
  114. "byteLength": 49,
  115. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  116. },
  117. {
  118. "sequence": 6,
  119. "offsetMs": 90100,
  120. "byteLength": 179,
  121. "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"
  122. },
  123. {
  124. "sequence": 7,
  125. "offsetMs": 90200,
  126. "byteLength": 42,
  127. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  128. }
  129. ]
  130. }
  131. }
  132. ]
  133. }