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

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