conversation-session-prewarming-queue.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-prewarming-queue",
  4. "spec": "./test/e2e/conversation-session/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": [
  20. "E2E_PREWARMING_DELAY",
  21. "E2E_PREWARMING_FIRST"
  22. ],
  23. "bodyExcludes": [
  24. "Generate a concise title",
  25. "CRITICAL: Respond with TEXT ONLY"
  26. ],
  27. "lastUserMessageIncludes": [
  28. "E2E_PREWARMING_DELAY"
  29. ]
  30. },
  31. "response": {
  32. "statusCode": 200,
  33. "statusMessage": "OK",
  34. "delayMs": 6000,
  35. "headers": {
  36. "cache-control": "no-cache",
  37. "content-type": "text/event-stream; charset=utf-8"
  38. },
  39. "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",
  40. "events": [
  41. {
  42. "sequence": 0,
  43. "offsetMs": 0,
  44. "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"
  45. },
  46. {
  47. "sequence": 1,
  48. "offsetMs": 100,
  49. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  50. },
  51. {
  52. "sequence": 2,
  53. "offsetMs": 200,
  54. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\n\n"
  55. },
  56. {
  57. "sequence": 3,
  58. "offsetMs": 300,
  59. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  60. },
  61. {
  62. "sequence": 4,
  63. "offsetMs": 400,
  64. "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"
  65. },
  66. {
  67. "sequence": 5,
  68. "offsetMs": 500,
  69. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  70. }
  71. ]
  72. }
  73. },
  74. {
  75. "id": "upstream-prewarming-queue-queued-marker-contract",
  76. "description": "A02 queued marker 合同占位;该请求不应实际发出,用于 fixture check 记录被验证的不发送语义。",
  77. "metadata": {
  78. "kind": "main",
  79. "timingPolicy": "fast-text",
  80. "source": "synthetic",
  81. "syntheticReason": "queued prompt 的产品语义是不发送到 provider;fixture 只覆盖 marker 合同,运行时若命中反而说明队列 guard 失效。"
  82. },
  83. "maxMatches": 0,
  84. "match": {
  85. "method": "POST",
  86. "pathIncludes": "/messages",
  87. "bodyIncludes": [
  88. "E2E_PREWARMING_QUEUED"
  89. ],
  90. "bodyExcludes": [
  91. "Generate a concise title",
  92. "CRITICAL: Respond with TEXT ONLY"
  93. ],
  94. "lastUserMessageIncludes": [
  95. "E2E_PREWARMING_QUEUED"
  96. ]
  97. },
  98. "response": {
  99. "statusCode": 200,
  100. "text": {
  101. "id": "upstream-e2e-prewarming-queued-should-not-send",
  102. "inputTokens": 128,
  103. "outputTokens": 12,
  104. "text": "upstream-e2e-ok"
  105. }
  106. }
  107. }
  108. ]
  109. }