conversation-session-bash-foreground-sleep-block.json 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-bash-foreground-sleep-block",
  4. "spec": "./test/e2e/conversation-session/tools/conversation-session-bash-foreground-sleep-block.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "bash-sleep-block-title",
  8. "description": "为本 case 的首轮 session title generation 提供固定辅助响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成与前台 sleep 拦截无关,但必须独立收口,避免抢占或阻塞主链路 fixture。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "lastUserMessageIncludes": ["E2E_BASH_SLEEP_BLOCK"],
  20. "bodyIncludes": ["Generate a concise title"]
  21. },
  22. "response": {
  23. "statusCode": 200,
  24. "statusMessage": "OK",
  25. "headers": {
  26. "content-type": "application/json; charset=utf-8"
  27. },
  28. "body": "{\"id\":\"e2e-bash-sleep-block-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"e2e-model\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Bash Sleep Block E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":32,\"output_tokens\":8}}"
  29. }
  30. },
  31. {
  32. "id": "bash-sleep-block-call",
  33. "description": "首轮返回第一个子命令是 sleep 30 的前台 Bash,validateInput 在执行前拒绝。",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "fast-tool-use",
  37. "source": "synthetic",
  38. "syntheticReason": "真实模型不一定发出前台长 sleep;固定 tool_use 才能稳定证明拦截发生在执行前。"
  39. },
  40. "maxMatches": 1,
  41. "match": {
  42. "method": "POST",
  43. "pathIncludes": "/messages",
  44. "lastUserMessageIncludes": ["E2E_BASH_SLEEP_BLOCK"],
  45. "bodyExcludes": [
  46. "toolu_e2e_bash_sleep_block",
  47. "E2E_BASH_SLEEP_BLOCK_COLD_REPLAY",
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "toolUse": {
  55. "id": "toolu_e2e_bash_sleep_block",
  56. "name": "Bash",
  57. "input": {
  58. "command": "sleep 30 && echo E2E_BASH_SLEEP_BLOCK_RAN > sleep-block-ran.txt",
  59. "description": "E2E foreground sleep block"
  60. }
  61. }
  62. }
  63. },
  64. {
  65. "id": "bash-sleep-block-live-continuation",
  66. "description": "拒绝原因作为 error tool_result 进入 live continuation 后固定收口。",
  67. "metadata": {
  68. "kind": "main",
  69. "timingPolicy": "fast-text",
  70. "source": "synthetic",
  71. "syntheticReason": "响应正文只用于稳定结束首轮;核心证据是请求中精确的 error tool_result。"
  72. },
  73. "maxMatches": 1,
  74. "match": {
  75. "method": "POST",
  76. "pathIncludes": "/messages",
  77. "lastUserMessageIncludes": [
  78. "<tool_use_error>Blocked: sleep 30 followed by: echo E2E_BASH_SLEEP_BLOCK_RAN."
  79. ],
  80. "bodyIncludes": ["E2E_BASH_SLEEP_BLOCK", "toolu_e2e_bash_sleep_block"],
  81. "bodyExcludes": [
  82. "E2E_BASH_SLEEP_BLOCK_COLD_REPLAY",
  83. "Generate a concise title",
  84. "CRITICAL: Respond with TEXT ONLY"
  85. ]
  86. },
  87. "response": {
  88. "statusCode": 200,
  89. "text": {
  90. "id": "e2e-bash-sleep-block-live",
  91. "inputTokens": 128,
  92. "outputTokens": 12,
  93. "text": "E2E_BASH_SLEEP_BLOCK_LIVE_OK"
  94. }
  95. }
  96. },
  97. {
  98. "id": "bash-sleep-block-cold-followup",
  99. "description": "完整 CLI cold restart 后发送下一轮,固定回复用于捕获 hydration 后的 provider history。",
  100. "metadata": {
  101. "kind": "main",
  102. "timingPolicy": "fast-text",
  103. "source": "synthetic",
  104. "syntheticReason": "响应正文只用于稳定结束 cold follow-up;核心证据是历史 error tool_result 与 live 字节一致。"
  105. },
  106. "maxMatches": 1,
  107. "match": {
  108. "method": "POST",
  109. "pathIncludes": "/messages",
  110. "lastUserMessageIncludes": ["E2E_BASH_SLEEP_BLOCK_COLD_REPLAY"],
  111. "bodyIncludes": [
  112. "toolu_e2e_bash_sleep_block",
  113. "<tool_use_error>Blocked: sleep 30 followed by: echo E2E_BASH_SLEEP_BLOCK_RAN."
  114. ],
  115. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  116. },
  117. "response": {
  118. "statusCode": 200,
  119. "text": {
  120. "id": "e2e-bash-sleep-block-cold",
  121. "inputTokens": 128,
  122. "outputTokens": 12,
  123. "text": "E2E_BASH_SLEEP_BLOCK_COLD_OK"
  124. }
  125. }
  126. }
  127. ]
  128. }