conversation-session-plan-mode-capabilities.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-plan-mode-capabilities",
  4. "spec": "./test/e2e/conversation-session/planning/conversation-session-plan-mode-capabilities.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-plan-mode-capabilities-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-plan-mode-deny-enter-plan-call",
  31. "description": "首轮请求稳定返回 EnterPlanMode 工具调用,制造 plan mode 审批前置状态。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "需要稳定制造 plan mode 状态,避免依赖真实模型是否选择 EnterPlanMode。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_PLAN_MODE_DENY_STOPS_TURN"],
  43. "bodyIncludes": [
  44. "E2E_PLAN_MODE_DENY_STOPS_TURN",
  45. "E2E_PLAN_MODE_DENY_ENTER_PLAN",
  46. "E2E_PLAN_MODE_DENY_EXIT_PLAN"
  47. ],
  48. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "toolUse": {
  53. "id": "toolu_e2e_plan_mode_deny_enter_plan_mode",
  54. "name": "EnterPlanMode",
  55. "input": {}
  56. }
  57. }
  58. },
  59. {
  60. "id": "upstream-plan-mode-deny-exit-plan-call",
  61. "description": "进入 plan mode 后返回 ExitPlanMode 工具调用,触发审批弹窗。",
  62. "metadata": {
  63. "kind": "main",
  64. "timingPolicy": "fast-text",
  65. "source": "synthetic",
  66. "syntheticReason": "需要稳定触发 ExitPlanMode 审批弹窗,避免模型输出文本而跳过工具。"
  67. },
  68. "maxMatches": 1,
  69. "match": {
  70. "method": "POST",
  71. "pathIncludes": "/messages",
  72. "bodyIncludes": [
  73. "E2E_PLAN_MODE_DENY_EXIT_PLAN",
  74. "toolu_e2e_plan_mode_deny_enter_plan_mode"
  75. ],
  76. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  77. },
  78. "response": {
  79. "statusCode": 200,
  80. "toolUse": {
  81. "id": "toolu_e2e_plan_mode_deny_exit_plan_mode",
  82. "name": "ExitPlanMode",
  83. "input": {
  84. "plan": "E2E_PLAN_MODE_DENY_PLAN_BODY: 1. Inspect current implementation. 2. Wait for user approval before edits."
  85. }
  86. }
  87. }
  88. },
  89. {
  90. "id": "upstream-plan-mode-deny-follow-up-final",
  91. "description": "无反馈拒绝 ExitPlanMode 后,下一条用户输入仍带 plan mode reminder 并可完成。",
  92. "metadata": {
  93. "kind": "main",
  94. "timingPolicy": "fast-text",
  95. "source": "synthetic",
  96. "syntheticReason": "需要断言 deny without feedback 停止当前 turn,但不退出 plan mode。"
  97. },
  98. "maxMatches": 1,
  99. "match": {
  100. "method": "POST",
  101. "pathIncludes": "/messages",
  102. "lastUserMessageIncludes": ["E2E_PLAN_MODE_DENY_NEXT_INPUT"],
  103. "bodyIncludes": [
  104. "E2E_PLAN_MODE_DENY_NEXT_INPUT",
  105. "Plan mode is active",
  106. "MUST NOT make any edits"
  107. ],
  108. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  109. },
  110. "response": {
  111. "statusCode": 200,
  112. "text": "upstream-e2e-ok"
  113. }
  114. },
  115. {
  116. "id": "upstream-plan-mode-boundary-enter-plan-call",
  117. "description": "工具边界 case 首轮请求稳定返回 EnterPlanMode。",
  118. "metadata": {
  119. "kind": "main",
  120. "timingPolicy": "fast-text",
  121. "source": "synthetic",
  122. "syntheticReason": "需要稳定制造 plan mode 状态,避免依赖真实模型是否选择 EnterPlanMode。"
  123. },
  124. "maxMatches": 1,
  125. "match": {
  126. "method": "POST",
  127. "pathIncludes": "/messages",
  128. "lastUserMessageIncludes": ["E2E_PLAN_MODE_TOOL_BOUNDARY"],
  129. "bodyIncludes": [
  130. "E2E_PLAN_MODE_TOOL_BOUNDARY",
  131. "E2E_PLAN_MODE_TOOL_BOUNDARY_ENTER",
  132. "E2E_PLAN_MODE_TOOL_BOUNDARY_MIXED"
  133. ],
  134. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  135. },
  136. "response": {
  137. "statusCode": 200,
  138. "toolUse": {
  139. "id": "toolu_e2e_plan_mode_boundary_enter_plan_mode",
  140. "name": "EnterPlanMode",
  141. "input": {}
  142. }
  143. }
  144. },
  145. {
  146. "id": "upstream-plan-mode-boundary-mixed-tools-call",
  147. "description": "同一 assistant 回复里返回 Write 与 Read;Write 应被 plan mode 拒绝,Read 仍执行。",
  148. "metadata": {
  149. "kind": "main",
  150. "timingPolicy": "fast-text",
  151. "source": "synthetic",
  152. "syntheticReason": "需要稳定制造同一回复内先写后读的工具组,证明普通拒绝不阻断后续只读工具。"
  153. },
  154. "maxMatches": 1,
  155. "match": {
  156. "method": "POST",
  157. "pathIncludes": "/messages",
  158. "bodyIncludes": [
  159. "E2E_PLAN_MODE_TOOL_BOUNDARY_MIXED",
  160. "toolu_e2e_plan_mode_boundary_enter_plan_mode"
  161. ],
  162. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  163. },
  164. "response": {
  165. "statusCode": 200,
  166. "toolUses": [
  167. {
  168. "id": "toolu_e2e_plan_mode_boundary_write",
  169. "name": "Write",
  170. "input": {
  171. "file_path": "{{e2eRuntimeRoot}}/conversation-session-plan-mode-capabilities/zcode-e2e-plan-mode-denied-write.txt",
  172. "content": "this file must not be written in plan mode\n"
  173. }
  174. },
  175. {
  176. "id": "toolu_e2e_plan_mode_boundary_read",
  177. "name": "Read",
  178. "input": {
  179. "file_path": "{{e2eRuntimeRoot}}/shared/readonly-tool.txt"
  180. }
  181. }
  182. ]
  183. }
  184. },
  185. {
  186. "id": "upstream-plan-mode-boundary-final",
  187. "description": "provider-visible 请求同时包含写拒绝和只读 Read 结果后返回固定文本。",
  188. "metadata": {
  189. "kind": "main",
  190. "timingPolicy": "fast-text",
  191. "source": "synthetic",
  192. "syntheticReason": "核心合同是同一 continuation 中同时出现写拒绝 tool_result 与真实 Read tool_result。"
  193. },
  194. "maxMatches": 1,
  195. "match": {
  196. "method": "POST",
  197. "pathIncludes": "/messages",
  198. "bodyIncludes": [
  199. "E2E_PLAN_MODE_TOOL_BOUNDARY_MIXED",
  200. "toolu_e2e_plan_mode_boundary_write",
  201. "toolu_e2e_plan_mode_boundary_read",
  202. "Plan mode only allows read-only, non-destructive tools",
  203. "E2E_READONLY_TOOL_FILE_CONTENT"
  204. ],
  205. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  206. },
  207. "response": {
  208. "statusCode": 200,
  209. "text": "upstream-e2e-ok"
  210. }
  211. }
  212. ]
  213. }