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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-glm52-reasoning-request-shape",
  4. "spec": "./test/e2e/conversation-session/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": "固定响应同时守住 title sidecar 的 GLM-5.2 关闭思考请求字段,防止重新继承 max。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  18. "bodyIncludes": ["Generate a concise title", "\"reasoning_effort\":\"none\""],
  19. "bodyExcludes": ["extra_body", "chat_template_kwargs", "\"thinking\""]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "statusMessage": "OK",
  24. "headers": {
  25. "content-type": "text/event-stream; charset=utf-8"
  26. },
  27. "body": "data: {\"id\":\"chatcmpl-glm52-reasoning-title\",\"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-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"{\\\"title\\\":\\\"GLM Reasoning\\\"}\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-glm52-reasoning-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"GLM-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":64,\"completion_tokens\":8,\"total_tokens\":72}}\n\ndata: [DONE]\n\n"
  28. }
  29. },
  30. {
  31. "id": "glm52-reasoning-max-main",
  32. "description": "I14 GLM-5.2 选择 max 思考档位后首发普通文本的固定最终回复,配合抓包断言 OpenAI-compatible 请求字段。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "核心断言在 provider/model 身份、OpenAI-compatible transport 和 GLM-5.2 max 请求 body;响应只需稳定完成并包含约定文本。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/chat/completions",
  43. "lastUserMessageIncludes": ["E2E_GLM52_REASONING_MAX"],
  44. "bodyIncludes": ["E2E_GLM52_REASONING_MAX", "upstream-e2e-ok", "GLM-5.2"],
  45. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "statusMessage": "OK",
  50. "headers": {
  51. "content-type": "text/event-stream; charset=utf-8"
  52. },
  53. "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"
  54. }
  55. },
  56. {
  57. "id": "glm52-reasoning-nothink-main",
  58. "description": "I14 GLM-5.2 从 max 切到 nothink 后续发普通文本的固定最终回复,配合抓包断言关闭思考请求字段。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "核心断言在同一 provider/model 下后续请求切换 nothink 后的 GLM-5.2 专属请求 body;响应只需稳定完成并包含约定文本。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/chat/completions",
  69. "lastUserMessageIncludes": ["E2E_GLM52_REASONING_NOTHINK"],
  70. "bodyIncludes": ["E2E_GLM52_REASONING_NOTHINK", "upstream-e2e-ok", "GLM-5.2"],
  71. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "statusMessage": "OK",
  76. "headers": {
  77. "content-type": "text/event-stream; charset=utf-8"
  78. },
  79. "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"
  80. }
  81. }
  82. ]
  83. }