conversation-session-tool-history-order.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-tool-history-order",
  4. "spec": "./test/e2e/conversation-session/tools/conversation-session-tool-history-order.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "d19-title",
  8. "description": "D19 工具历史顺序:d19-title。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "固定 Bash→Read 声明,比较 live 与 latest-user edit 后的 provider tool_use/tool_result 顺序和内容。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_TOOL_ORDER_SOURCE"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"d19-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Tool history order\\\"}\"}],\"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": "d19-tools",
  30. "description": "D19 工具历史顺序:d19-tools。",
  31. "metadata": {
  32. "kind": "main",
  33. "source": "synthetic",
  34. "timingPolicy": "tool-use",
  35. "syntheticReason": "固定 Bash→Read 声明,比较 live 与 latest-user edit 后的 provider tool_use/tool_result 顺序和内容。"
  36. },
  37. "match": {
  38. "method": "POST",
  39. "pathIncludes": "/messages",
  40. "lastUserMessageIncludes": ["E2E_TOOL_ORDER_SOURCE"],
  41. "bodyExcludes": [
  42. "Generate a concise title",
  43. "CRITICAL: Respond with TEXT ONLY",
  44. "toolu_d19_bash"
  45. ]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "toolUses": [
  50. {
  51. "id": "toolu_d19_bash",
  52. "name": "Bash",
  53. "input": {
  54. "command": "node -e \"console.log(12345)\""
  55. }
  56. },
  57. {
  58. "id": "toolu_d19_read",
  59. "name": "Read",
  60. "input": {
  61. "file_path": "{{e2eRuntimeRoot}}/conversation-session-tool-history-order/read.txt"
  62. }
  63. }
  64. ]
  65. }
  66. },
  67. {
  68. "id": "d19-followup",
  69. "description": "D19 工具历史顺序:d19-followup。",
  70. "metadata": {
  71. "kind": "main",
  72. "source": "synthetic",
  73. "timingPolicy": "fast-text",
  74. "syntheticReason": "固定 Bash→Read 声明,比较 live 与 latest-user edit 后的 provider tool_use/tool_result 顺序和内容。"
  75. },
  76. "match": {
  77. "method": "POST",
  78. "pathIncludes": "/messages",
  79. "bodyIncludes": [
  80. "E2E_TOOL_ORDER_SOURCE",
  81. "tool_result",
  82. "toolu_d19_bash",
  83. "toolu_d19_read"
  84. ],
  85. "bodyExcludes": [
  86. "Generate a concise title",
  87. "CRITICAL: Respond with TEXT ONLY",
  88. "E2E_TOOL_ORDER_LATER",
  89. "E2E_TOOL_ORDER_EDITED"
  90. ]
  91. },
  92. "response": {
  93. "statusCode": 200,
  94. "text": {
  95. "id": "d19-followup",
  96. "inputTokens": 64,
  97. "outputTokens": 8,
  98. "text": "D19_SOURCE_DONE"
  99. }
  100. }
  101. },
  102. {
  103. "id": "d19-later",
  104. "description": "D19 工具历史顺序:d19-later。",
  105. "metadata": {
  106. "kind": "main",
  107. "source": "synthetic",
  108. "timingPolicy": "fast-text",
  109. "syntheticReason": "固定 Bash→Read 声明,比较 live 与 latest-user edit 后的 provider tool_use/tool_result 顺序和内容。"
  110. },
  111. "match": {
  112. "method": "POST",
  113. "pathIncludes": "/messages",
  114. "lastUserMessageIncludes": ["E2E_TOOL_ORDER_LATER"],
  115. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  116. },
  117. "response": {
  118. "statusCode": 200,
  119. "text": {
  120. "id": "d19-later",
  121. "inputTokens": 64,
  122. "outputTokens": 8,
  123. "text": "D19_LATER_DONE"
  124. }
  125. }
  126. },
  127. {
  128. "id": "d19-edited",
  129. "description": "D19 工具历史顺序:d19-edited。",
  130. "metadata": {
  131. "kind": "main",
  132. "source": "synthetic",
  133. "timingPolicy": "fast-text",
  134. "syntheticReason": "固定 Bash→Read 声明,比较 live 与 latest-user edit 后的 provider tool_use/tool_result 顺序和内容。"
  135. },
  136. "match": {
  137. "method": "POST",
  138. "pathIncludes": "/messages",
  139. "lastUserMessageIncludes": ["E2E_TOOL_ORDER_EDITED"],
  140. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  141. },
  142. "response": {
  143. "statusCode": 200,
  144. "text": {
  145. "id": "d19-edited",
  146. "inputTokens": 64,
  147. "outputTokens": 8,
  148. "text": "D19_EDITED_DONE"
  149. }
  150. }
  151. }
  152. ]
  153. }