conversation-session-composer-recent-mode.json 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-composer-recent-mode",
  4. "spec": "./test/e2e/conversation-session/conversation-session-composer-recent-mode.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "recent-mode-title",
  8. "description": "I74: 新任务继承最近提交权限的受控响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "隔离模型输出,验证真实 Composer 提交、新任务初始化及 Write 权限行为。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_COMPOSER_RECENT_MODE"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "recent-mode-title",
  24. "text": "{\"title\":\"Recent permission E2E\"}",
  25. "inputTokens": 64,
  26. "outputTokens": 8
  27. }
  28. }
  29. },
  30. {
  31. "id": "recent-mode-compact",
  32. "description": "切换模型后压缩现有历史的受控响应。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "实际切模型会触发压缩;保留 Write 历史供后续提交继续,避免缺少压缩 fixture 造成 500 重试。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_COMPOSER_RECENT_MODE_WRITE", "CRITICAL: Respond with TEXT ONLY"],
  43. "bodyExcludes": ["Generate a concise title"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "text": {
  48. "id": "recent-mode-compact",
  49. "text": "<summary>The user requested E2E_COMPOSER_RECENT_MODE_WRITE. The Write tool completed successfully and the assistant replied RECENT_MODE_DONE.</summary>",
  50. "inputTokens": 80,
  51. "outputTokens": 40
  52. }
  53. }
  54. },
  55. {
  56. "id": "recent-mode-seed",
  57. "description": "I74: 新任务继承最近提交权限的受控响应。",
  58. "metadata": {
  59. "kind": "main",
  60. "timingPolicy": "controlled-stream",
  61. "source": "synthetic",
  62. "syntheticReason": "隔离模型输出,验证真实 Composer 提交、新任务初始化及 Write 权限行为。"
  63. },
  64. "match": {
  65. "method": "POST",
  66. "pathIncludes": "/messages",
  67. "lastUserMessageIncludes": ["E2E_COMPOSER_RECENT_MODE_SEED"],
  68. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  69. },
  70. "response": {
  71. "statusCode": 200,
  72. "statusMessage": "OK",
  73. "headers": {
  74. "cache-control": "no-cache",
  75. "content-type": "text/event-stream; charset=utf-8"
  76. },
  77. "chunks": [
  78. {
  79. "offsetMs": 0,
  80. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"recent-mode-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  81. },
  82. {
  83. "offsetMs": 250,
  84. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  85. },
  86. {
  87. "offsetMs": 500,
  88. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"RECENT_MODE_STREAMING \"}}\n\n"
  89. },
  90. {
  91. "offsetMs": 45000,
  92. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  93. },
  94. {
  95. "offsetMs": 45100,
  96. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  97. },
  98. {
  99. "offsetMs": 45200,
  100. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  101. }
  102. ],
  103. "text": {
  104. "id": "recent-mode-slow",
  105. "inputTokens": 80,
  106. "outputTokens": 4,
  107. "text": "RECENT_MODE_STREAMING"
  108. }
  109. }
  110. },
  111. {
  112. "id": "recent-mode-second",
  113. "description": "TD02 第二次切模型和权限后发送。",
  114. "metadata": {
  115. "kind": "main",
  116. "timingPolicy": "fast-text",
  117. "source": "synthetic",
  118. "syntheticReason": "固定输出验证第二次实际提交更新 Recent 后,空白页不覆盖模型与权限。"
  119. },
  120. "match": {
  121. "method": "POST",
  122. "pathIncludes": "/messages",
  123. "lastUserMessageIncludes": ["E2E_COMPOSER_RECENT_MODE_SECOND"],
  124. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  125. },
  126. "response": {
  127. "statusCode": 200,
  128. "text": {
  129. "id": "recent-mode-second",
  130. "text": "RECENT_MODE_SECOND_DONE",
  131. "inputTokens": 80,
  132. "outputTokens": 8
  133. }
  134. }
  135. },
  136. {
  137. "id": "recent-mode-write",
  138. "description": "I74: 新任务继承最近提交权限的受控响应。",
  139. "metadata": {
  140. "kind": "main",
  141. "timingPolicy": "fast-text",
  142. "source": "synthetic",
  143. "syntheticReason": "隔离模型输出,验证真实 Composer 提交、新任务初始化及 Write 权限行为。"
  144. },
  145. "match": {
  146. "method": "POST",
  147. "pathIncludes": "/messages",
  148. "lastUserMessageIncludes": ["E2E_COMPOSER_RECENT_MODE_WRITE"],
  149. "bodyExcludes": [
  150. "Generate a concise title",
  151. "CRITICAL: Respond with TEXT ONLY",
  152. "toolu_recent_mode_write"
  153. ]
  154. },
  155. "response": {
  156. "statusCode": 200,
  157. "toolUse": {
  158. "id": "toolu_recent_mode_write",
  159. "name": "Write",
  160. "input": {
  161. "file_path": "{{e2eRuntimeRoot}}/conversation-session-composer-recent-mode/result.txt",
  162. "content": "RECENT_MODE_WRITE_OK\n"
  163. }
  164. }
  165. }
  166. },
  167. {
  168. "id": "recent-mode-final",
  169. "description": "I74: Write 工具结果后回复;最后一条 user 已是工具结果,按完整历史中的提示词和工具 ID 匹配。",
  170. "metadata": {
  171. "kind": "main",
  172. "timingPolicy": "fast-text",
  173. "source": "synthetic",
  174. "syntheticReason": "隔离模型输出,验证真实 Composer 提交、新任务初始化及 Write 权限行为。"
  175. },
  176. "match": {
  177. "method": "POST",
  178. "pathIncludes": "/messages",
  179. "bodyIncludes": ["E2E_COMPOSER_RECENT_MODE_WRITE", "toolu_recent_mode_write"],
  180. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  181. },
  182. "response": {
  183. "statusCode": 200,
  184. "text": {
  185. "id": "recent-mode-final",
  186. "text": "RECENT_MODE_DONE",
  187. "inputTokens": 80,
  188. "outputTokens": 8
  189. }
  190. }
  191. }
  192. ]
  193. }