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

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