conversation-session-prewarming-queue.json 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-prewarming-queue",
  4. "spec": "./test/e2e/conversation-session/queue/conversation-session-prewarming-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-prewarming-queue-first-delay",
  8. "description": "A02 prewarming 首轮延迟响应,稳定制造继续输入入队窗口。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "prewarming queue 需要首轮请求保持提交/流式窗口,真实模型可能过快完成。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": ["E2E_PREWARMING_DELAY", "E2E_PREWARMING_FIRST"],
  20. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  21. "lastUserMessageIncludes": ["E2E_PREWARMING_DELAY"]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "statusMessage": "OK",
  26. "delayMs": 6000,
  27. "headers": {
  28. "cache-control": "no-cache",
  29. "content-type": "text/event-stream; charset=utf-8"
  30. },
  31. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-prewarming-delay\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  32. "events": [
  33. {
  34. "sequence": 0,
  35. "offsetMs": 0,
  36. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-prewarming-delay\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  37. },
  38. {
  39. "sequence": 1,
  40. "offsetMs": 100,
  41. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  42. },
  43. {
  44. "sequence": 2,
  45. "offsetMs": 200,
  46. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\n\n"
  47. },
  48. {
  49. "sequence": 3,
  50. "offsetMs": 300,
  51. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  52. },
  53. {
  54. "sequence": 4,
  55. "offsetMs": 400,
  56. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  57. },
  58. {
  59. "sequence": 5,
  60. "offsetMs": 500,
  61. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  62. }
  63. ]
  64. }
  65. },
  66. {
  67. "id": "upstream-prewarming-queue-queued-marker-contract",
  68. "description": "A02 queued marker 合同占位;该请求不应实际发出,用于 fixture check 记录被验证的不发送语义。",
  69. "metadata": {
  70. "kind": "main",
  71. "timingPolicy": "fast-text",
  72. "source": "synthetic",
  73. "syntheticReason": "queued prompt 的产品语义是不发送到 provider;fixture 只覆盖 marker 合同,运行时若命中反而说明队列 guard 失效。"
  74. },
  75. "maxMatches": 0,
  76. "match": {
  77. "method": "POST",
  78. "pathIncludes": "/messages",
  79. "bodyIncludes": ["E2E_PREWARMING_QUEUED"],
  80. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  81. "lastUserMessageIncludes": ["E2E_PREWARMING_QUEUED"]
  82. },
  83. "response": {
  84. "statusCode": 200,
  85. "text": {
  86. "id": "upstream-e2e-prewarming-queued-should-not-send",
  87. "inputTokens": 128,
  88. "outputTokens": 12,
  89. "text": "upstream-e2e-ok"
  90. }
  91. }
  92. }
  93. ]
  94. }