conversation-session-plan-mode-mcp-permission.json 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-plan-mode-mcp-permission",
  4. "spec": "./test/e2e/conversation-session/planning/conversation-session-plan-mode-mcp-permission.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-plan-mode-mcp-permission-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-mcp-enter-plan",
  31. "description": "首轮请求返回 EnterPlanMode,让后续 MCP 工具调用处在 plan mode。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "稳定制造 plan mode 状态,避免依赖真实模型是否主动进入计划模式。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_PLAN_MODE_MCP_PERMISSION"],
  43. "bodyIncludes": [
  44. "E2E_PLAN_MODE_MCP_PERMISSION",
  45. "mcp__plan_mode_e2e__lookup",
  46. "mcp__plan_mode_e2e__reset"
  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_mcp_enter_plan",
  54. "name": "EnterPlanMode",
  55. "input": {}
  56. }
  57. }
  58. },
  59. {
  60. "id": "upstream-plan-mode-mcp-lookup",
  61. "description": "plan mode 内调用未声明 readOnlyHint 的非 destructive MCP 工具。",
  62. "metadata": {
  63. "kind": "main",
  64. "timingPolicy": "fast-text",
  65. "source": "synthetic",
  66. "syntheticReason": "稳定覆盖 Plan mode 对非 destructive MCP 的单次询问:允许一次后才执行。"
  67. },
  68. "maxMatches": 1,
  69. "match": {
  70. "method": "POST",
  71. "pathIncludes": "/messages",
  72. "bodyIncludes": ["E2E_PLAN_MODE_MCP_PERMISSION", "toolu_e2e_plan_mcp_enter_plan"],
  73. "bodyExcludes": [
  74. "E2E_PLAN_MCP_LOOKUP_RESULT",
  75. "Generate a concise title",
  76. "CRITICAL: Respond with TEXT ONLY"
  77. ]
  78. },
  79. "response": {
  80. "statusCode": 200,
  81. "toolUse": {
  82. "id": "toolu_e2e_plan_mcp_lookup",
  83. "name": "mcp__plan_mode_e2e__lookup",
  84. "input": {
  85. "query": "E2E_PLAN_MCP_LOOKUP_QUERY"
  86. }
  87. }
  88. }
  89. },
  90. {
  91. "id": "upstream-plan-mode-mcp-destructive-reset",
  92. "description": "lookup 工具真实执行后,继续尝试 destructive MCP 工具。",
  93. "metadata": {
  94. "kind": "main",
  95. "timingPolicy": "fast-text",
  96. "source": "synthetic",
  97. "syntheticReason": "稳定覆盖同一 plan turn 中 destructive MCP 仍需被拒绝。"
  98. },
  99. "maxMatches": 1,
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "bodyIncludes": [
  104. "E2E_PLAN_MODE_MCP_PERMISSION",
  105. "toolu_e2e_plan_mcp_lookup",
  106. "E2E_PLAN_MCP_LOOKUP_RESULT:E2E_PLAN_MCP_LOOKUP_QUERY"
  107. ],
  108. "bodyExcludes": [
  109. "toolu_e2e_plan_mcp_reset",
  110. "Generate a concise title",
  111. "CRITICAL: Respond with TEXT ONLY"
  112. ]
  113. },
  114. "response": {
  115. "statusCode": 200,
  116. "toolUse": {
  117. "id": "toolu_e2e_plan_mcp_reset",
  118. "name": "mcp__plan_mode_e2e__reset",
  119. "input": {
  120. "marker": "E2E_PLAN_MCP_DESTRUCTIVE_ATTEMPT"
  121. }
  122. }
  123. }
  124. },
  125. {
  126. "id": "upstream-plan-mode-mcp-final",
  127. "description": "destructive MCP 被 Plan mode 拒绝后,模型消费拒绝结果并最终回复。",
  128. "metadata": {
  129. "kind": "main",
  130. "timingPolicy": "fast-text",
  131. "source": "synthetic",
  132. "syntheticReason": "证明 destructive MCP 的拒绝结果进入 provider-visible 请求且同一轮可正常收口。"
  133. },
  134. "maxMatches": 1,
  135. "match": {
  136. "method": "POST",
  137. "pathIncludes": "/messages",
  138. "bodyIncludes": [
  139. "E2E_PLAN_MODE_MCP_PERMISSION",
  140. "toolu_e2e_plan_mcp_reset",
  141. "Plan mode only allows read-only, non-destructive tools"
  142. ],
  143. "bodyExcludes": [
  144. "E2E_PLAN_MCP_RESET_SHOULD_NOT_RUN",
  145. "Generate a concise title",
  146. "CRITICAL: Respond with TEXT ONLY"
  147. ]
  148. },
  149. "response": {
  150. "statusCode": 200,
  151. "text": "upstream-e2e-ok"
  152. }
  153. }
  154. ]
  155. }