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

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