conversation-session-model-switch-restore-repro.json 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-switch-restore-repro",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-switch-restore-repro.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-conversation-model-switch-restore-repro-quota-failure",
  8. "description": "复现用户日志里的第一轮 quota-like 失败态,随后允许同一 session 切模型继续发送。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "fault-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "复现探针需要稳定制造失败态,避免依赖真实 GLM 额度。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_RESTORE_REPRO_FAIL"],
  19. "bodyIncludes": ["E2E_MODEL_SWITCH_RESTORE_REPRO_FAIL"],
  20. "bodyExcludes": ["Generate a concise title", "E2E_MODEL_SWITCH_RESTORE_REPRO_SUCCESS"]
  21. },
  22. "response": {
  23. "statusCode": 429,
  24. "statusMessage": "Too Many Requests",
  25. "headers": {
  26. "content-type": "application/json; charset=utf-8"
  27. },
  28. "body": "{\"error\":{\"message\":\"已达到 5 小时的使用上限。您的限额将在 2026-06-25 18:11:31 重置。\",\"type\":\"rate_limit_error\",\"code\":\"rate_limit_exceeded\"}}"
  29. }
  30. },
  31. {
  32. "id": "upstream-conversation-model-switch-restore-repro-success",
  33. "description": "失败态后切换模型配置的成功回复,用固定 token 验证恢复后是否仍可见。",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "fast-text",
  37. "source": "synthetic",
  38. "syntheticReason": "复现探针只需要稳定产出一条 completed assistant。"
  39. },
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_RESTORE_REPRO_SUCCESS"],
  44. "bodyIncludes": ["E2E_MODEL_SWITCH_RESTORE_REPRO_SUCCESS"],
  45. "bodyExcludes": ["Generate a concise title"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "statusMessage": "OK",
  50. "headers": {
  51. "cache-control": "no-cache",
  52. "content-type": "text/event-stream; charset=utf-8"
  53. },
  54. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-restore-repro-success\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_MODEL_SWITCH_RESTORE_REPRO_ASSISTANT_VISIBLE\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  55. }
  56. }
  57. ]
  58. }