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

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