conversation-session-glm52-reasoning-request-shape.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-glm52-reasoning-request-shape",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-glm52-reasoning-request-shape.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "glm52-reasoning-request-shape-title",
  8. "description": "GLM-5.2 OpenAI-compatible 思考档位 case 内的标题生成固定响应,避免严格 case-local replay 依赖其他 case。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "真实标题请求通过 thinking.type=disabled 与 reasoning_effort=none 明确关闭思考;旧 matcher 禁止整个 thinking 字段导致 Missing Fixture 500。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "\"reasoning_effort\":\"none\"",
  21. "\"thinking\":{\"type\":\"disabled\"}"
  22. ],
  23. "bodyExcludes": ["extra_body", "chat_template_kwargs"]
  24. },
  25. "response": {
  26. "statusCode": 200,
  27. "statusMessage": "OK",
  28. "headers": {
  29. "content-type": "application/json; charset=utf-8"
  30. },
  31. "body": "{\"id\":\"chatcmpl-glm52-reasoning-title\",\"object\":\"chat.completion\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"GLM Reasoning\\\"}\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":64,\"completion_tokens\":8,\"total_tokens\":72}}"
  32. }
  33. },
  34. {
  35. "id": "glm52-reasoning-max-main",
  36. "description": "I14 GLM-5.2 选择 max 思考档位后首发普通文本的固定最终回复,配合抓包断言 OpenAI-compatible 请求字段。",
  37. "metadata": {
  38. "kind": "main",
  39. "timingPolicy": "fast-text",
  40. "source": "synthetic",
  41. "syntheticReason": "核心断言在 provider/model 身份、OpenAI-compatible transport 和 GLM-5.2 max 请求 body;响应只需稳定完成并包含约定文本。"
  42. },
  43. "maxMatches": 1,
  44. "match": {
  45. "method": "POST",
  46. "pathIncludes": "/chat/completions",
  47. "lastUserMessageIncludes": ["E2E_GLM52_REASONING_MAX"],
  48. "bodyIncludes": ["E2E_GLM52_REASONING_MAX", "upstream-e2e-ok", "GLM-5.2"],
  49. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  50. },
  51. "response": {
  52. "statusCode": 200,
  53. "statusMessage": "OK",
  54. "headers": {
  55. "content-type": "text/event-stream; charset=utf-8"
  56. },
  57. "body": "data: {\"id\":\"chatcmpl-glm52-reasoning-max\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-glm52-reasoning-max\",\"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-glm52-reasoning-max\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":128,\"completion_tokens\":12,\"total_tokens\":140}}\n\ndata: [DONE]\n\n"
  58. }
  59. },
  60. {
  61. "id": "glm52-reasoning-nothink-main",
  62. "description": "I14 GLM-5.2 从 max 切到 nothink 后续发普通文本的固定最终回复,配合抓包断言关闭思考请求字段。",
  63. "metadata": {
  64. "kind": "main",
  65. "timingPolicy": "fast-text",
  66. "source": "synthetic",
  67. "syntheticReason": "核心断言在同一 provider/model 下后续请求切换 nothink 后的 GLM-5.2 专属请求 body;响应只需稳定完成并包含约定文本。"
  68. },
  69. "maxMatches": 1,
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/chat/completions",
  73. "lastUserMessageIncludes": ["E2E_GLM52_REASONING_NOTHINK"],
  74. "bodyIncludes": ["E2E_GLM52_REASONING_NOTHINK", "upstream-e2e-ok", "GLM-5.2"],
  75. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  76. },
  77. "response": {
  78. "statusCode": 200,
  79. "statusMessage": "OK",
  80. "headers": {
  81. "content-type": "text/event-stream; charset=utf-8"
  82. },
  83. "body": "data: {\"id\":\"chatcmpl-glm52-reasoning-nothink\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-glm52-reasoning-nothink\",\"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-glm52-reasoning-nothink\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":132,\"completion_tokens\":12,\"total_tokens\":144}}\n\ndata: [DONE]\n\n"
  84. }
  85. }
  86. ]
  87. }