conversation-session-composer-draft-switching.json 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-composer-draft-switching",
  4. "spec": "./test/e2e/conversation-session/composer/conversation-session-composer-draft-switching.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-composer-draft-switching-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-composer-draft-completed-seed-final",
  31. "description": "R01 completed task 草稿作用域的 seed turn 固定回复。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "该响应只需要稳定形成 completed task,后续断言聚焦 composer 草稿正文和附件的 taskId 作用域恢复。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_COMPOSER_DRAFT_COMPLETED_SEED"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  44. "lastUserMessageIncludes": ["E2E_COMPOSER_DRAFT_COMPLETED_SEED"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": {
  49. "id": "upstream-e2e-composer-draft-completed-seed-final",
  50. "inputTokens": 128,
  51. "outputTokens": 12,
  52. "text": "upstream-e2e-ok"
  53. }
  54. }
  55. },
  56. {
  57. "id": "upstream-composer-draft-running-seed-slow-stream",
  58. "description": "R02 running task 草稿作用域的慢流响应,稳定制造 task 切换窗口。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "controlled-stream",
  62. "source": "synthetic",
  63. "syntheticReason": "running task 草稿恢复必须在 assistant 仍可能 streaming 时验证;真实 provider 可能过快完成,导致无法稳定覆盖 inactive stream 更新。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_COMPOSER_DRAFT_RUNNING_SEED"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  71. "lastUserMessageIncludes": ["E2E_COMPOSER_DRAFT_RUNNING_SEED"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "statusMessage": "OK",
  76. "headers": {
  77. "cache-control": "no-cache",
  78. "content-type": "text/event-stream; charset=utf-8"
  79. },
  80. "events": [
  81. {
  82. "sequence": 0,
  83. "offsetMs": 0,
  84. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-composer-draft-running-seed-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"
  85. },
  86. {
  87. "sequence": 1,
  88. "offsetMs": 250,
  89. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  90. },
  91. {
  92. "sequence": 2,
  93. "offsetMs": 8000,
  94. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  95. },
  96. {
  97. "sequence": 3,
  98. "offsetMs": 16000,
  99. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  100. },
  101. {
  102. "sequence": 4,
  103. "offsetMs": 24000,
  104. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  105. },
  106. {
  107. "sequence": 5,
  108. "offsetMs": 90000,
  109. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  110. },
  111. {
  112. "sequence": 6,
  113. "offsetMs": 90100,
  114. "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"
  115. },
  116. {
  117. "sequence": 7,
  118. "offsetMs": 90200,
  119. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  120. }
  121. ]
  122. }
  123. },
  124. {
  125. "id": "upstream-composer-draft-completed-text-should-not-send",
  126. "description": "R01 completed task 的未发送 composer 草稿正文不应触发 provider 请求。",
  127. "metadata": {
  128. "kind": "ignore",
  129. "timingPolicy": "fast-text",
  130. "source": "synthetic",
  131. "syntheticReason": "composer 草稿正文只应保存在本地 draft scope;切换 task 不应把草稿内容作为 user prompt 发送给 provider。"
  132. },
  133. "maxMatches": 0,
  134. "match": {
  135. "method": "POST",
  136. "pathIncludes": "/messages",
  137. "bodyIncludes": ["E2E_COMPOSER_DRAFT_COMPLETED_TEXT"],
  138. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  139. },
  140. "response": {
  141. "statusCode": 200,
  142. "text": {
  143. "id": "upstream-e2e-composer-draft-completed-text-should-not-send",
  144. "inputTokens": 128,
  145. "outputTokens": 12,
  146. "text": "upstream-e2e-ok"
  147. }
  148. }
  149. },
  150. {
  151. "id": "upstream-composer-draft-running-text-should-not-send",
  152. "description": "R02 running task 的未发送 composer 草稿正文不应触发 provider 请求。",
  153. "metadata": {
  154. "kind": "ignore",
  155. "timingPolicy": "fast-text",
  156. "source": "synthetic",
  157. "syntheticReason": "running task 切换期间 composer 草稿正文只应保存在本地 draft scope;inactive stream 更新不应把草稿内容发送给 provider。"
  158. },
  159. "maxMatches": 0,
  160. "match": {
  161. "method": "POST",
  162. "pathIncludes": "/messages",
  163. "bodyIncludes": ["E2E_COMPOSER_DRAFT_RUNNING_TEXT"],
  164. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  165. },
  166. "response": {
  167. "statusCode": 200,
  168. "text": {
  169. "id": "upstream-e2e-composer-draft-running-text-should-not-send",
  170. "inputTokens": 128,
  171. "outputTokens": 12,
  172. "text": "upstream-e2e-ok"
  173. }
  174. }
  175. },
  176. {
  177. "id": "upstream-composer-draft-unsent-text-should-not-send",
  178. "description": "R03 未发送 new task 草稿正文不应触发 provider 请求。",
  179. "metadata": {
  180. "kind": "ignore",
  181. "timingPolicy": "fast-text",
  182. "source": "synthetic",
  183. "syntheticReason": "未发送的新 task 草稿只应保存在 __draft__ scope;切换到已有 task 再返回不应触发 provider 请求。"
  184. },
  185. "maxMatches": 0,
  186. "match": {
  187. "method": "POST",
  188. "pathIncludes": "/messages",
  189. "bodyIncludes": ["E2E_COMPOSER_DRAFT_UNSENT_TEXT"],
  190. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  191. },
  192. "response": {
  193. "statusCode": 200,
  194. "text": {
  195. "id": "upstream-e2e-composer-draft-unsent-text-should-not-send",
  196. "inputTokens": 128,
  197. "outputTokens": 12,
  198. "text": "upstream-e2e-ok"
  199. }
  200. }
  201. }
  202. ]
  203. }