conversation-session-turn-error-queue-preserved.json 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-turn-error-queue-preserved",
  4. "spec": "./test/e2e/conversation-session/conversation-session-turn-error-queue-preserved.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "turn-error-queue-preserved-source-500",
  8. "description": "N05:主 turn 在 queue 入队窗口后返回 500 JSON error。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "fault-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "真实 provider 500 的响应时间不可控;delayMs 只用于稳定制造 running admission 窗口,验证错误终态的 queue 保留契约。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "lastUserMessageIncludes": ["E2E_TURN_ERROR_QUEUE_SOURCE"],
  20. "bodyIncludes": ["E2E_TURN_ERROR_QUEUE_SOURCE"],
  21. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  22. },
  23. "response": {
  24. "delayMs": 3000,
  25. "statusCode": 500,
  26. "statusMessage": "Internal Server Error",
  27. "headers": {
  28. "content-type": "application/json; charset=utf-8"
  29. },
  30. "body": "{\"error\":{\"message\":\"synthetic provider failure\",\"type\":\"provider_error\",\"code\":\"e2e_turn_error\"}}"
  31. }
  32. },
  33. {
  34. "id": "turn-error-queue-preserved-followup",
  35. "description": "NQ:错误后的队首输入显式继续消费成功。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "fast-text",
  39. "source": "synthetic",
  40. "syntheticReason": "恢复路径需要固定 assistant 哨兵,证明 queue 未丢失且只在显式继续后发送。"
  41. },
  42. "maxMatches": 1,
  43. "match": {
  44. "method": "POST",
  45. "pathIncludes": "/messages",
  46. "lastUserMessageIncludes": ["E2E_TURN_ERROR_QUEUE_FOLLOWUP"],
  47. "bodyIncludes": ["E2E_TURN_ERROR_QUEUE_FOLLOWUP"],
  48. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "text": {
  53. "id": "turn-error-queue-preserved-followup",
  54. "inputTokens": 96,
  55. "outputTokens": 8,
  56. "text": "TURN_ERROR_QUEUE_RECOVERED"
  57. }
  58. }
  59. }
  60. ]
  61. }