conversation-session-compact-stream-fallback.json 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-compact-stream-fallback",
  4. "spec": "./test/e2e/conversation-session/conversation-session-compact-stream-fallback.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "compact-stream-fallback-title",
  8. "description": "compact stream fallback seed 首发的 case-local 标题响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "首发会触发 title sidecar;固定标题响应并用 case marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_COMPACT_STREAM_FALLBACK_SEED"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "compact-stream-fallback-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"Compact Stream Fallback E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "compact-stream-fallback-seed",
  35. "description": "形成可 compact 的稳定历史。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "fast-text",
  39. "source": "synthetic",
  40. "syntheticReason": "transport fallback 门禁只需要一段已完成历史;固定文本避免真实 provider 漂移。"
  41. },
  42. "maxMatches": 1,
  43. "match": {
  44. "method": "POST",
  45. "pathIncludes": "/messages",
  46. "lastUserMessageIncludes": ["E2E_COMPACT_STREAM_FALLBACK_SEED"],
  47. "bodyExcludes": [
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "text": {
  55. "id": "compact-stream-fallback-seed",
  56. "inputTokens": 80,
  57. "outputTokens": 8,
  58. "text": "COMPACT_STREAM_FALLBACK_SEED_OK"
  59. }
  60. }
  61. },
  62. {
  63. "id": "compact-stream-fallback-stream-failure",
  64. "description": "compact 首个 stream 请求的确定性 non-retryable 失败。",
  65. "metadata": {
  66. "kind": "fault",
  67. "timingPolicy": "fault-stream",
  68. "source": "synthetic",
  69. "syntheticReason": "fixture 只有在 compact body 明确包含 stream:true 时命中,以稳定证明 stream-first;404 避免 adapter 内部重试放大。"
  70. },
  71. "maxMatches": 1,
  72. "match": {
  73. "method": "POST",
  74. "pathIncludes": "/messages",
  75. "bodyIncludes": [
  76. "E2E_COMPACT_STREAM_FALLBACK_SEED",
  77. "COMPACT_STREAM_FALLBACK_SEED_OK",
  78. "CRITICAL: Respond with TEXT ONLY",
  79. "\"stream\":true"
  80. ],
  81. "bodyExcludes": ["Generate a concise title"]
  82. },
  83. "response": {
  84. "statusCode": 404,
  85. "statusMessage": "Not Found",
  86. "headers": {
  87. "content-type": "application/json; charset=utf-8"
  88. },
  89. "body": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Streaming is not supported for this compact fixture.\"}}"
  90. }
  91. },
  92. {
  93. "id": "compact-stream-fallback-non-stream-success",
  94. "description": "同一逻辑 compact attempt 的 non-stream JSON fallback 成功响应。",
  95. "metadata": {
  96. "kind": "main",
  97. "timingPolicy": "fast-text",
  98. "source": "synthetic",
  99. "syntheticReason": "fixture 显式排除 stream:true,证明首腿失败后才进入 non-stream,并固定 summary 以验证最终 success marker。"
  100. },
  101. "maxMatches": 1,
  102. "match": {
  103. "method": "POST",
  104. "pathIncludes": "/messages",
  105. "bodyIncludes": [
  106. "E2E_COMPACT_STREAM_FALLBACK_SEED",
  107. "COMPACT_STREAM_FALLBACK_SEED_OK",
  108. "CRITICAL: Respond with TEXT ONLY"
  109. ],
  110. "bodyExcludes": [
  111. "Generate a concise title",
  112. "\"stream\":true"
  113. ]
  114. },
  115. "response": {
  116. "statusCode": 200,
  117. "statusMessage": "OK",
  118. "headers": {
  119. "content-type": "application/json; charset=utf-8"
  120. },
  121. "body": "{\"id\":\"compact-stream-fallback-summary\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"<analysis>Desktop compact retried the hidden summary over non-stream transport after the stream leg failed before any committed block.</analysis>\\n\\n<summary>Conversation so far: the user requested the compact stream fallback seed response, and the assistant returned COMPACT_STREAM_FALLBACK_SEED_OK. No tools or files were used.</summary>\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":64}}"
  122. }
  123. }
  124. ]
  125. }