conversation-session-empty-completion-retry.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-empty-completion-retry",
  4. "spec": "./test/e2e/conversation-session/conversation-session-empty-completion-retry.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "empty-completion-retry-title",
  8. "description": "空 completion retry case 的标题 sidecar 固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不是空 completion retry 的产品语义;固定响应避免 title sidecar 依赖共享 legacy fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_EMPTY_COMPLETION_RETRY_STREAM"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "empty-completion-retry-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"Empty Completion Retry E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "empty-completion-retry-stream-first-empty",
  35. "description": "首个主请求正常 EOF 收口,但 finish=other 且 text/reasoning/tool/usage 全为空。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "fast-text",
  39. "source": "synthetic",
  40. "syntheticReason": "稳定制造 provider 正常 EOF + finish=other 的零输出 completion,验证 adapter 隐藏首个 attempt 并只重试一次。"
  41. },
  42. "maxMatches": 1,
  43. "match": {
  44. "method": "POST",
  45. "pathIncludes": "/messages",
  46. "lastUserMessageIncludes": [
  47. "E2E_EMPTY_COMPLETION_RETRY_STREAM"
  48. ],
  49. "bodyExcludes": [
  50. "Generate a concise title",
  51. "CRITICAL: Respond with TEXT ONLY"
  52. ]
  53. },
  54. "response": {
  55. "statusCode": 200,
  56. "statusMessage": "OK",
  57. "headers": {
  58. "cache-control": "no-cache",
  59. "content-type": "text/event-stream; charset=utf-8"
  60. },
  61. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"empty-completion-retry-first-empty\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0}}}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"other\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  62. }
  63. },
  64. {
  65. "id": "empty-completion-retry-stream-second-success",
  66. "description": "第二个主请求返回正常文本,作为唯一一次 retry 的成功结果。",
  67. "metadata": {
  68. "kind": "main",
  69. "timingPolicy": "fast-text",
  70. "source": "synthetic",
  71. "syntheticReason": "固定 retry 后的成功文本,证明首个空 attempt 没有泄漏到 UI 且逻辑 turn 正常收口。"
  72. },
  73. "maxMatches": 1,
  74. "match": {
  75. "method": "POST",
  76. "pathIncludes": "/messages",
  77. "lastUserMessageIncludes": [
  78. "E2E_EMPTY_COMPLETION_RETRY_STREAM"
  79. ],
  80. "bodyExcludes": [
  81. "Generate a concise title",
  82. "CRITICAL: Respond with TEXT ONLY"
  83. ]
  84. },
  85. "response": {
  86. "statusCode": 200,
  87. "statusMessage": "OK",
  88. "headers": {
  89. "cache-control": "no-cache",
  90. "content-type": "text/event-stream; charset=utf-8"
  91. },
  92. "text": {
  93. "id": "empty-completion-retry-stream-second-success",
  94. "inputTokens": 96,
  95. "outputTokens": 8,
  96. "text": "EMPTY_COMPLETION_RETRY_OK"
  97. }
  98. }
  99. }
  100. ]
  101. }