conversation-session-background-file-diff.json 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background-file-diff",
  4. "spec": "./test/e2e/conversation-session/background/conversation-session-background-file-diff.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-background-file-diff-title",
  8. "description": "BG41 会话标题 sidecar 固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不参与 model-only 文件 checkpoint 语义,只用 case marker 隔离请求。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_BACKGROUND_FILE_DIFF"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"upstream-background-file-diff-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Background File Diff 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": "upstream-background-file-diff-agent-tool",
  30. "description": "BG41 父模型启动一个真实 background Agent。",
  31. "metadata": {
  32. "kind": "main",
  33. "timingPolicy": "fast-tool-use",
  34. "source": "synthetic",
  35. "syntheticReason": "固定 Agent(run_in_background=true),制造父 launch turn 与后续 model-only notification turn。"
  36. },
  37. "maxMatches": 1,
  38. "match": {
  39. "method": "POST",
  40. "pathIncludes": "/messages",
  41. "bodyIncludes": ["E2E_BACKGROUND_FILE_DIFF", "background-file-diff-e2e/result.md"],
  42. "bodyExcludes": [
  43. "Async agent launched successfully",
  44. "Generate a concise title",
  45. "CRITICAL: Respond with TEXT ONLY",
  46. "Verify whether the active session goal"
  47. ],
  48. "lastUserMessageExcludes": ["<task-notification>"],
  49. "lastUserMessageIncludes": ["E2E_BACKGROUND_FILE_DIFF"]
  50. },
  51. "response": {
  52. "statusCode": 200,
  53. "toolUse": {
  54. "id": "toolu_e2e_background_file_diff_agent",
  55. "messageId": "msg_e2e_background_file_diff_agent",
  56. "name": "Agent",
  57. "input": {
  58. "description": "BG41 update background diff",
  59. "prompt": "E2E_BACKGROUND_FILE_DIFF_CHILD: Return exactly E2E_BACKGROUND_FILE_DIFF_CHILD_DONE.",
  60. "run_in_background": true
  61. }
  62. }
  63. }
  64. },
  65. {
  66. "id": "upstream-background-file-diff-launch-ack",
  67. "description": "BG41 父模型在 async launch result 后先结束启动轮。",
  68. "metadata": {
  69. "kind": "main",
  70. "timingPolicy": "fast-text",
  71. "source": "synthetic",
  72. "syntheticReason": "让父 turn 在 child 完成前稳定 idle,确保后续走独立 model-only wake。"
  73. },
  74. "maxMatches": 1,
  75. "match": {
  76. "method": "POST",
  77. "pathIncludes": "/messages",
  78. "bodyIncludes": [
  79. "E2E_BACKGROUND_FILE_DIFF",
  80. "toolu_e2e_background_file_diff_agent",
  81. "Async agent launched successfully"
  82. ],
  83. "bodyExcludes": [
  84. "Generate a concise title",
  85. "CRITICAL: Respond with TEXT ONLY",
  86. "Verify whether the active session goal"
  87. ],
  88. "lastUserMessageExcludes": ["<task-notification>"]
  89. },
  90. "response": {
  91. "statusCode": 200,
  92. "text": {
  93. "id": "upstream-background-file-diff-launch-ack",
  94. "inputTokens": 96,
  95. "outputTokens": 8,
  96. "text": "background-file-diff-agent-launched-ok"
  97. }
  98. }
  99. },
  100. {
  101. "id": "upstream-background-file-diff-child-result",
  102. "description": "BG41 child 延迟完成,为父 launch turn idle 留出稳定观察窗口。",
  103. "metadata": {
  104. "kind": "subagent",
  105. "timingPolicy": "delayed-text",
  106. "source": "synthetic",
  107. "syntheticReason": "六秒延迟确保 UI 先稳定观测 canStop=false,再触发独立 notification wake。"
  108. },
  109. "maxMatches": 1,
  110. "match": {
  111. "method": "POST",
  112. "pathIncludes": "/messages",
  113. "bodyIncludes": ["E2E_BACKGROUND_FILE_DIFF_CHILD"],
  114. "bodyExcludes": [
  115. "background-file-diff-agent-launched-ok",
  116. "Async agent launched successfully",
  117. "Generate a concise title",
  118. "CRITICAL: Respond with TEXT ONLY"
  119. ],
  120. "lastUserMessageIncludes": ["E2E_BACKGROUND_FILE_DIFF_CHILD"]
  121. },
  122. "response": {
  123. "statusCode": 200,
  124. "delayMs": 6000,
  125. "text": {
  126. "id": "upstream-background-file-diff-child-result",
  127. "inputTokens": 64,
  128. "outputTokens": 8,
  129. "text": "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE"
  130. }
  131. }
  132. },
  133. {
  134. "id": "upstream-background-file-diff-read",
  135. "description": "BG41 独立 model-only notification turn 先读取既有文件。",
  136. "metadata": {
  137. "kind": "main",
  138. "timingPolicy": "fast-tool-use",
  139. "source": "synthetic",
  140. "syntheticReason": "固定 Read 建立 read-before-edit 前提,并让 checkpoint anchor 来自隐藏 notification messageId。"
  141. },
  142. "maxMatches": 1,
  143. "match": {
  144. "method": "POST",
  145. "pathIncludes": "/messages",
  146. "bodyIncludes": [
  147. "E2E_BACKGROUND_FILE_DIFF",
  148. "<task-notification>",
  149. "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE"
  150. ],
  151. "bodyExcludes": [
  152. "toolu_e2e_background_file_diff_read",
  153. "Generate a concise title",
  154. "CRITICAL: Respond with TEXT ONLY",
  155. "Verify whether the active session goal"
  156. ],
  157. "lastUserMessageIncludes": ["<task-notification>", "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE"]
  158. },
  159. "response": {
  160. "statusCode": 200,
  161. "toolUse": {
  162. "id": "toolu_e2e_background_file_diff_read",
  163. "messageId": "msg_e2e_background_file_diff_read",
  164. "name": "Read",
  165. "input": {
  166. "file_path": "background-file-diff-e2e/result.md"
  167. }
  168. }
  169. }
  170. },
  171. {
  172. "id": "upstream-background-file-diff-edit",
  173. "description": "BG41 Read result 后在同一 model-only product turn 编辑单文件。",
  174. "metadata": {
  175. "kind": "main",
  176. "timingPolicy": "fast-tool-use",
  177. "source": "synthetic",
  178. "syntheticReason": "固定单行替换以精确断言摘要 +1/-1 和 Review before/after 内容。"
  179. },
  180. "maxMatches": 1,
  181. "match": {
  182. "method": "POST",
  183. "pathIncludes": "/messages",
  184. "bodyIncludes": [
  185. "E2E_BACKGROUND_FILE_DIFF",
  186. "<task-notification>",
  187. "toolu_e2e_background_file_diff_read",
  188. "before-background-diff"
  189. ],
  190. "bodyExcludes": [
  191. "toolu_e2e_background_file_diff_edit",
  192. "Generate a concise title",
  193. "CRITICAL: Respond with TEXT ONLY",
  194. "Verify whether the active session goal"
  195. ]
  196. },
  197. "response": {
  198. "statusCode": 200,
  199. "toolUse": {
  200. "id": "toolu_e2e_background_file_diff_edit",
  201. "messageId": "msg_e2e_background_file_diff_edit",
  202. "name": "Edit",
  203. "input": {
  204. "file_path": "background-file-diff-e2e/result.md",
  205. "old_string": "before-background-diff",
  206. "new_string": "after-background-diff"
  207. }
  208. }
  209. }
  210. },
  211. {
  212. "id": "upstream-background-file-diff-final",
  213. "description": "BG41 Edit 成功后结束独立 notification product turn。",
  214. "metadata": {
  215. "kind": "main",
  216. "timingPolicy": "fast-text",
  217. "source": "synthetic",
  218. "syntheticReason": "固定最终 marker,用于确认文件摘要与 background 结果 assistant 归属同一产品轮次。"
  219. },
  220. "maxMatches": 1,
  221. "match": {
  222. "method": "POST",
  223. "pathIncludes": "/messages",
  224. "bodyIncludes": [
  225. "E2E_BACKGROUND_FILE_DIFF",
  226. "<task-notification>",
  227. "toolu_e2e_background_file_diff_edit",
  228. "The file background-file-diff-e2e/result.md has been updated successfully"
  229. ],
  230. "bodyExcludes": [
  231. "Generate a concise title",
  232. "CRITICAL: Respond with TEXT ONLY",
  233. "Verify whether the active session goal"
  234. ]
  235. },
  236. "response": {
  237. "statusCode": 200,
  238. "text": {
  239. "id": "upstream-background-file-diff-final",
  240. "inputTokens": 160,
  241. "outputTokens": 8,
  242. "text": "background-file-diff-ok"
  243. }
  244. }
  245. }
  246. ]
  247. }