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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-compact-stream-fallback",
  4. "spec": "./test/e2e/conversation-session/context/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": ["Generate a concise title", "E2E_COMPACT_STREAM_FALLBACK_SEED"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "compact-stream-fallback-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"Compact Stream Fallback E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "compact-stream-fallback-seed",
  32. "description": "形成可 compact 的稳定历史。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "transport fallback 门禁只需要一段已完成历史;固定文本避免真实 provider 漂移。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "lastUserMessageIncludes": ["E2E_COMPACT_STREAM_FALLBACK_SEED"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": {
  49. "id": "compact-stream-fallback-seed",
  50. "inputTokens": 80,
  51. "outputTokens": 8,
  52. "text": "COMPACT_STREAM_FALLBACK_SEED_OK"
  53. }
  54. }
  55. },
  56. {
  57. "id": "compact-stream-fallback-stream-failure",
  58. "description": "compact 首个 stream 请求的确定性 non-retryable 失败。",
  59. "metadata": {
  60. "kind": "fault",
  61. "timingPolicy": "fault-stream",
  62. "source": "synthetic",
  63. "syntheticReason": "fixture 只有在 compact body 明确包含 stream:true 时命中,以稳定证明 stream-first;404 避免 adapter 内部重试放大。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "bodyIncludes": [
  70. "E2E_COMPACT_STREAM_FALLBACK_SEED",
  71. "COMPACT_STREAM_FALLBACK_SEED_OK",
  72. "CRITICAL: Respond with TEXT ONLY",
  73. "\"stream\":true"
  74. ],
  75. "bodyExcludes": ["Generate a concise title"]
  76. },
  77. "response": {
  78. "statusCode": 404,
  79. "statusMessage": "Not Found",
  80. "headers": {
  81. "content-type": "application/json; charset=utf-8"
  82. },
  83. "body": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Streaming is not supported for this compact fixture.\"}}"
  84. }
  85. },
  86. {
  87. "id": "compact-stream-fallback-non-stream-success",
  88. "description": "同一逻辑 compact attempt 的 non-stream JSON fallback 成功响应。",
  89. "metadata": {
  90. "kind": "main",
  91. "timingPolicy": "fast-text",
  92. "source": "synthetic",
  93. "syntheticReason": "fixture 显式排除 stream:true,证明首腿失败后才进入 non-stream,并固定 summary 以验证最终 success marker。"
  94. },
  95. "maxMatches": 1,
  96. "match": {
  97. "method": "POST",
  98. "pathIncludes": "/messages",
  99. "bodyIncludes": [
  100. "E2E_COMPACT_STREAM_FALLBACK_SEED",
  101. "COMPACT_STREAM_FALLBACK_SEED_OK",
  102. "CRITICAL: Respond with TEXT ONLY"
  103. ],
  104. "bodyExcludes": ["Generate a concise title", "\"stream\":true"]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "statusMessage": "OK",
  109. "headers": {
  110. "content-type": "application/json; charset=utf-8"
  111. },
  112. "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}}"
  113. }
  114. }
  115. ]
  116. }