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

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