conversation-session-webfetch.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-webfetch",
  4. "spec": "./test/e2e/conversation-session/tools/conversation-session-webfetch.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-conversation-webfetch-title",
  8. "description": "WebFetch case 的标题生成固定响应,避免严格 case-local replay 依赖 legacy provider-basic。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不属于 O10 产品语义,只需要稳定返回,避免标题请求误命中主流程 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_WEBFETCH_REQUEST"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-webfetch-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"WebFetch E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-conversation-webfetch-tool-use",
  31. "description": "O10 首段响应:固定触发 WebFetch 访问本 case 的 MITM stub 目标。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "tool-use",
  35. "source": "synthetic",
  36. "syntheticReason": "真实 provider 不一定稳定选择 WebFetch;本响应固定触发 WebFetch,专门验证 agent HttpClientPort 成功抓取闭环。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_WEBFETCH_REQUEST"],
  43. "bodyIncludes": [
  44. "E2E_WEBFETCH_REQUEST",
  45. "E2E_WEBFETCH_FINAL_OK",
  46. "https://webfetch.e2e.test/e2e-webfetch-success",
  47. "WebFetch"
  48. ],
  49. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  50. },
  51. "response": {
  52. "statusCode": 200,
  53. "toolUse": {
  54. "id": "toolu_e2e_webfetch_success",
  55. "messageId": "msg_e2e_webfetch_tool_use",
  56. "name": "WebFetch",
  57. "input": {
  58. "url": "https://webfetch.e2e.test/e2e-webfetch-success",
  59. "prompt": "Extract the e2e marker from the fetched page."
  60. }
  61. }
  62. }
  63. },
  64. {
  65. "id": "upstream-conversation-webfetch-lite-extraction",
  66. "description": "WebFetch 内部 lite model 请求:从 MITM stub HTML 中提取固定 marker。",
  67. "metadata": {
  68. "kind": "main",
  69. "timingPolicy": "fast-text",
  70. "source": "synthetic",
  71. "syntheticReason": "真实 lite model 输出不可控;本响应固定返回提取结果,用于验证 WebFetch 工具结果回灌主模型。"
  72. },
  73. "maxMatches": 1,
  74. "match": {
  75. "method": "POST",
  76. "pathIncludes": "/messages",
  77. "bodyIncludes": [
  78. "Web page content:",
  79. "E2E_WEBFETCH_HTML_MARKER",
  80. "Extract the e2e marker from the fetched page."
  81. ],
  82. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  83. },
  84. "response": {
  85. "statusCode": 200,
  86. "statusMessage": "OK",
  87. "headers": {
  88. "content-type": "application/json; charset=utf-8"
  89. },
  90. "body": "{\"id\":\"msg_e2e_webfetch_lite\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"E2E_WEBFETCH_EXTRACTED_OK\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":180,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
  91. }
  92. },
  93. {
  94. "id": "upstream-conversation-webfetch-final",
  95. "description": "O10 最终回复:WebFetch tool_result 已进入后续主模型请求。",
  96. "metadata": {
  97. "kind": "main",
  98. "timingPolicy": "fast-text",
  99. "source": "synthetic",
  100. "syntheticReason": "核心断言是 WebFetch 成功 tool_result 进入 continuation;最终文案只需稳定收口。"
  101. },
  102. "maxMatches": 1,
  103. "match": {
  104. "method": "POST",
  105. "pathIncludes": "/messages",
  106. "bodyIncludes": [
  107. "E2E_WEBFETCH_REQUEST",
  108. "toolu_e2e_webfetch_success",
  109. "E2E_WEBFETCH_EXTRACTED_OK"
  110. ],
  111. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  112. },
  113. "response": {
  114. "statusCode": 200,
  115. "statusMessage": "OK",
  116. "text": {
  117. "id": "msg_e2e_webfetch_final",
  118. "inputTokens": 240,
  119. "outputTokens": 12,
  120. "text": "E2E_WEBFETCH_FINAL_OK"
  121. }
  122. }
  123. }
  124. ]
  125. }