conversation-session-permission-full-access.json 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-permission-full-access",
  4. "spec": "./test/e2e/conversation-session/permissions/conversation-session-permission-full-access.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "pa158-title",
  8. "description": "E2E_PA158_MAIN 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_PA158_MAIN 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_PA158_MAIN"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"pa158-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"V4 Permission E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
  26. }
  27. },
  28. {
  29. "id": "pa158-write-call",
  30. "description": "M4 resolveInteraction 门禁:Write tool_use,默认模式下触发权限弹窗。",
  31. "metadata": {
  32. "kind": "main",
  33. "timingPolicy": "controlled-stream",
  34. "source": "synthetic",
  35. "syntheticReason": "PA158 在真实 Write 审批前保留受控窗口,通过 UI 排入混合 Plan 队列并暂停自动消费。"
  36. },
  37. "match": {
  38. "method": "POST",
  39. "pathIncludes": "/messages",
  40. "lastUserMessageIncludes": ["E2E_PA158_MAIN"],
  41. "bodyIncludes": ["E2E_PA158_MAIN"],
  42. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  43. },
  44. "response": {
  45. "statusCode": 200,
  46. "headers": {
  47. "content-type": "text/event-stream; charset=utf-8"
  48. },
  49. "chunks": [
  50. {
  51. "offsetMs": 0,
  52. "text": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"pa158-main\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"fixture\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 80, \"output_tokens\": 1}}}\n\n"
  53. },
  54. {
  55. "offsetMs": 10,
  56. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  57. },
  58. {
  59. "offsetMs": 20,
  60. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_PA158_RUNNING\"}}\n\n"
  61. },
  62. {
  63. "offsetMs": 20000,
  64. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  65. },
  66. {
  67. "offsetMs": 20010,
  68. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 1, \"content_block\": {\"type\": \"tool_use\", \"id\": \"toolu_v4_permission_write\", \"name\": \"Write\", \"input\": {}}}\n\n"
  69. },
  70. {
  71. "offsetMs": 20020,
  72. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 1, \"delta\": {\"type\": \"input_json_delta\", \"partial_json\": \"{\\\"file_path\\\": \\\"{{e2eRuntimeRoot}}/conversation-session-permission-full-access/output.txt\\\", \\\"content\\\": \\\"E2E_PA158_TOOL_RESULT\\\\n\\\"}\"}}\n\n"
  73. },
  74. {
  75. "offsetMs": 20030,
  76. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 1}\n\n"
  77. },
  78. {
  79. "offsetMs": 20040,
  80. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"tool_use\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 50}}\n\n"
  81. },
  82. {
  83. "offsetMs": 20050,
  84. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  85. }
  86. ]
  87. }
  88. },
  89. {
  90. "id": "pa158-final",
  91. "description": "M4 resolveInteraction 门禁:批准后 tool_result 回灌 → 最终文本。",
  92. "metadata": {
  93. "kind": "main",
  94. "timingPolicy": "fast-text",
  95. "source": "synthetic",
  96. "syntheticReason": "权限批准后工具执行成功,模型据 tool_result 给出终态文本。"
  97. },
  98. "match": {
  99. "method": "POST",
  100. "pathIncludes": "/messages",
  101. "bodyIncludes": ["E2E_PA158_MAIN", "toolu_v4_permission_write"],
  102. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  103. },
  104. "response": {
  105. "statusCode": 200,
  106. "headers": {
  107. "content-type": "text/event-stream; charset=utf-8"
  108. },
  109. "chunks": [
  110. {
  111. "offsetMs": 0,
  112. "text": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"pa158-final\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"fixture\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 80, \"output_tokens\": 1}}}\n\n"
  113. },
  114. {
  115. "offsetMs": 10,
  116. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  117. },
  118. {
  119. "offsetMs": 20,
  120. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_PA158_DONE\"}}\n\n"
  121. },
  122. {
  123. "offsetMs": 30000,
  124. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  125. },
  126. {
  127. "offsetMs": 30010,
  128. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"end_turn\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 8}}\n\n"
  129. },
  130. {
  131. "offsetMs": 30020,
  132. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  133. }
  134. ]
  135. }
  136. }
  137. ]
  138. }