conversation-session-v4-refresh-permission.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-refresh-permission",
  4. "spec": "./test/e2e/conversation-session/conversation-session-v4-refresh-permission.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-refresh-permission-title",
  8. "description": "E2E_V4_REFRESH_PERM 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_V4_REFRESH_PERM 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_V4_REFRESH_PERM"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "v4-refresh-permission-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"V4 Refresh Permission E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "v4-refresh-permission-write-call",
  35. "description": "刷新恢复×权限挂起:Bash redirect exact tool_use,触发权限弹窗后 renderer 刷新。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "fast-text",
  39. "source": "synthetic",
  40. "syntheticReason": "redirect 强制 exact suggestion,稳定验证刷新前后 scope 与 response。"
  41. },
  42. "match": {
  43. "method": "POST",
  44. "pathIncludes": "/messages",
  45. "lastUserMessageIncludes": ["E2E_V4_REFRESH_PERM"],
  46. "bodyExcludes": [
  47. "Generate a concise title",
  48. "CRITICAL: Respond with TEXT ONLY",
  49. "E2E_V4_REFRESH_PERM_REPEAT"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "toolUse": {
  55. "id": "toolu_v4_refresh_perm_bash",
  56. "name": "Bash",
  57. "input": {
  58. "command": "printf 'E2E_V4_REFRESH_PERM_RESULT\\n' > .zcode-e2e/conversation-session-v4-refresh-permission/write-output.txt"
  59. }
  60. }
  61. }
  62. },
  63. {
  64. "id": "v4-refresh-permission-final",
  65. "description": "刷新恢复×权限挂起:批准后 tool_result 回灌 → 最终文本。",
  66. "metadata": {
  67. "kind": "main",
  68. "timingPolicy": "fast-text",
  69. "source": "synthetic",
  70. "syntheticReason": "刷新后批准仍能路由回 CLI broker deferred,工具执行并收口。"
  71. },
  72. "match": {
  73. "method": "POST",
  74. "pathIncludes": "/messages",
  75. "bodyIncludes": ["E2E_V4_REFRESH_PERM", "toolu_v4_refresh_perm_bash"],
  76. "bodyExcludes": [
  77. "Generate a concise title",
  78. "CRITICAL: Respond with TEXT ONLY",
  79. "E2E_V4_REFRESH_PERM_REPEAT"
  80. ]
  81. },
  82. "response": {
  83. "statusCode": 200,
  84. "text": {
  85. "id": "v4-refresh-permission-final",
  86. "inputTokens": 80,
  87. "outputTokens": 8,
  88. "text": "V4_REFRESH_PERM_DONE"
  89. }
  90. }
  91. },
  92. {
  93. "id": "v4-refresh-permission-repeat-call",
  94. "description": "刷新后重复完全相同 Bash exact command。",
  95. "metadata": {
  96. "kind": "main",
  97. "timingPolicy": "fast-text",
  98. "source": "synthetic",
  99. "syntheticReason": "验证 allowAlways updates 已持久化且 v4 optionId 映射未丢失。"
  100. },
  101. "match": {
  102. "method": "POST",
  103. "pathIncludes": "/messages",
  104. "lastUserMessageIncludes": ["E2E_V4_REFRESH_PERM_REPEAT"],
  105. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  106. },
  107. "response": {
  108. "statusCode": 200,
  109. "toolUse": {
  110. "id": "toolu_v4_refresh_perm_repeat_bash",
  111. "name": "Bash",
  112. "input": {
  113. "command": "printf 'E2E_V4_REFRESH_PERM_RESULT\\n' > .zcode-e2e/conversation-session-v4-refresh-permission/write-output.txt"
  114. }
  115. }
  116. }
  117. },
  118. {
  119. "id": "v4-refresh-permission-repeat-final",
  120. "description": "重复 exact command 自动允许后的终态。",
  121. "metadata": {
  122. "kind": "main",
  123. "timingPolicy": "fast-text",
  124. "source": "synthetic",
  125. "syntheticReason": "无二次权限弹窗时稳定收口。"
  126. },
  127. "match": {
  128. "method": "POST",
  129. "pathIncludes": "/messages",
  130. "bodyIncludes": ["E2E_V4_REFRESH_PERM_REPEAT", "toolu_v4_refresh_perm_repeat_bash"],
  131. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  132. },
  133. "response": {
  134. "statusCode": 200,
  135. "text": {
  136. "id": "v4-refresh-permission-repeat-final",
  137. "inputTokens": 80,
  138. "outputTokens": 8,
  139. "text": "V4_REFRESH_PERM_REPEAT_DONE"
  140. }
  141. }
  142. }
  143. ]
  144. }