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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-permission-full-access",
  4. "spec": "./test/e2e/conversation-session/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. "text": {
  23. "id": "pa158-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"V4 Permission E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "pa158-write-call",
  32. "description": "M4 resolveInteraction 门禁:Write tool_use,默认模式下触发权限弹窗。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "controlled-stream",
  36. "source": "synthetic",
  37. "syntheticReason": "PA158 在真实 Write 审批前保留受控窗口,通过 UI 排入混合 Plan 队列并暂停自动消费。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_PA158_MAIN"],
  43. "bodyIncludes": ["E2E_PA158_MAIN"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "headers": {
  49. "content-type": "text/event-stream; charset=utf-8"
  50. },
  51. "chunks": [
  52. {
  53. "offsetMs": 0,
  54. "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"
  55. },
  56. {
  57. "offsetMs": 10,
  58. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  59. },
  60. {
  61. "offsetMs": 20,
  62. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_PA158_RUNNING\"}}\n\n"
  63. },
  64. {
  65. "offsetMs": 20000,
  66. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  67. },
  68. {
  69. "offsetMs": 20010,
  70. "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"
  71. },
  72. {
  73. "offsetMs": 20020,
  74. "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"
  75. },
  76. {
  77. "offsetMs": 20030,
  78. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 1}\n\n"
  79. },
  80. {
  81. "offsetMs": 20040,
  82. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"tool_use\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 50}}\n\n"
  83. },
  84. {
  85. "offsetMs": 20050,
  86. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  87. }
  88. ]
  89. }
  90. },
  91. {
  92. "id": "pa158-final",
  93. "description": "M4 resolveInteraction 门禁:批准后 tool_result 回灌 → 最终文本。",
  94. "metadata": {
  95. "kind": "main",
  96. "timingPolicy": "fast-text",
  97. "source": "synthetic",
  98. "syntheticReason": "权限批准后工具执行成功,模型据 tool_result 给出终态文本。"
  99. },
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "bodyIncludes": ["E2E_PA158_MAIN", "toolu_v4_permission_write"],
  104. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "headers": {
  109. "content-type": "text/event-stream; charset=utf-8"
  110. },
  111. "chunks": [
  112. {
  113. "offsetMs": 0,
  114. "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"
  115. },
  116. {
  117. "offsetMs": 10,
  118. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  119. },
  120. {
  121. "offsetMs": 20,
  122. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_PA158_DONE\"}}\n\n"
  123. },
  124. {
  125. "offsetMs": 30000,
  126. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  127. },
  128. {
  129. "offsetMs": 30010,
  130. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"end_turn\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 8}}\n\n"
  131. },
  132. {
  133. "offsetMs": 30020,
  134. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  135. }
  136. ]
  137. }
  138. }
  139. ]
  140. }