conversation-session-model-switch-image-strip.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-switch-image-strip",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-switch-image-strip.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "model-switch-image-strip-title",
  8. "description": "N08 图片历史模型切换 case 内的标题生成固定响应,避免严格 case-local replay 依赖 legacy provider-basic。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本 case 的产品语义,只需要稳定返回,防止标题请求误命中图片历史或 GLM follow-up 业务 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  18. "bodyIncludes": ["Generate a concise title", "E2E_MODEL_SWITCH_IMAGE_SEED"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "text/event-stream; charset=utf-8"
  25. },
  26. "body": "data: {\"id\":\"chatcmpl-model-switch-image-strip-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"{\\\"title\\\":\\\"Image Strip Switch\\\"}\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":64,\"completion_tokens\":8,\"total_tokens\":72}}\n\ndata: [DONE]\n\n"
  27. }
  28. },
  29. {
  30. "id": "model-switch-image-strip-seed",
  31. "description": "N08 首轮带真实 local path 图片的固定最终回复,用于把图片历史持久化到 completed session,并固定 image + 普通 path text 的 provider wire。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "核心断言发生在后续切到第三方 GLM 的 provider-visible 请求;首轮响应只需稳定完成并保留含 image + local path 的 user 历史。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/chat/completions",
  42. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_IMAGE_SEED"],
  43. "bodyIncludes": [
  44. "E2E_MODEL_SWITCH_IMAGE_SEED",
  45. "upstream-e2e-ok",
  46. "e2e-vision-seed-model",
  47. "[Image: source:",
  48. "model-switch-image-strip-"
  49. ],
  50. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "statusMessage": "OK",
  55. "headers": {
  56. "content-type": "text/event-stream; charset=utf-8"
  57. },
  58. "body": "data: {\"id\":\"chatcmpl-model-switch-image-strip-seed\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-vision-seed-model\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-seed\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-vision-seed-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-seed\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-vision-seed-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":156,\"completion_tokens\":12,\"total_tokens\":168}}\n\ndata: [DONE]\n\n"
  59. }
  60. },
  61. {
  62. "id": "model-switch-image-strip-glm-followup",
  63. "description": "N08 切到第三方 GLM-5.2 后续发普通文本的固定最终回复,配合抓包断言历史图片变为 omitted 文本但仍保留原 absolute path。",
  64. "metadata": {
  65. "kind": "main",
  66. "timingPolicy": "fast-text",
  67. "source": "synthetic",
  68. "syntheticReason": "核心断言在第三方 GLM provider-visible request 不再包含历史 image block/data URL,而是包含不支持图片输入的 omitted 文本和普通 path text;响应只需稳定完成并包含约定文本。"
  69. },
  70. "maxMatches": 1,
  71. "match": {
  72. "method": "POST",
  73. "pathIncludes": "/chat/completions",
  74. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_IMAGE_FOLLOWUP"],
  75. "bodyIncludes": [
  76. "E2E_MODEL_SWITCH_IMAGE_FOLLOWUP",
  77. "GLM-5.2",
  78. "[Attached image/png:",
  79. "model-switch-image-strip-",
  80. "Media omitted from provider request because the selected model does not support image input.",
  81. "[Image: source:"
  82. ],
  83. "bodyExcludes": [
  84. "data:image",
  85. "Generate a concise title",
  86. "CRITICAL: Respond with TEXT ONLY"
  87. ]
  88. },
  89. "response": {
  90. "statusCode": 200,
  91. "statusMessage": "OK",
  92. "headers": {
  93. "content-type": "text/event-stream; charset=utf-8"
  94. },
  95. "body": "data: {\"id\":\"chatcmpl-model-switch-image-strip-glm-followup\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-glm-followup\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-switch-image-strip-glm-followup\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":168,\"completion_tokens\":12,\"total_tokens\":180}}\n\ndata: [DONE]\n\n"
  96. }
  97. }
  98. ]
  99. }