conversation-session-queued-command-restart.json 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-queued-command-restart",
  4. "spec": "./test/e2e/conversation-session/conversation-session-queued-command-restart.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "queued-command-restart-title",
  8. "description": "PV4-25Q running session 的 case-local 标题响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "稳定创建任务列表行,供整进程重启后显式恢复原 session。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_QUEUED_COMMAND_RESTART_RUNNING"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "queued-command-restart-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"Queued Command Restart E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "queued-command-restart-running-turn",
  35. "description": "PV4-25Q controlled stream:保持首轮 running,让第二条输入真实进入 CLI queue。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "controlled-stream",
  39. "source": "synthetic",
  40. "syntheticReason": "只有 running 窗口才能形成 delivery=queue 的 durable session_input;随后由整进程重启真实转成 discarded。"
  41. },
  42. "maxMatches": 1,
  43. "match": {
  44. "method": "POST",
  45. "pathIncludes": "/messages",
  46. "lastUserMessageIncludes": ["E2E_QUEUED_COMMAND_RESTART_RUNNING"],
  47. "bodyExcludes": [
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "statusMessage": "OK",
  55. "headers": {
  56. "cache-control": "no-cache",
  57. "content-type": "text/event-stream; charset=utf-8"
  58. },
  59. "chunks": [
  60. {
  61. "offsetMs": 0,
  62. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"queued-command-restart-running\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  63. },
  64. {
  65. "offsetMs": 250,
  66. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  67. },
  68. {
  69. "offsetMs": 500,
  70. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"QUEUED_COMMAND_RESTART_STREAMING \"}}\n\n"
  71. },
  72. {
  73. "offsetMs": 45000,
  74. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  75. },
  76. {
  77. "offsetMs": 45100,
  78. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  79. },
  80. {
  81. "offsetMs": 45200,
  82. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  83. }
  84. ],
  85. "text": {
  86. "id": "queued-command-restart-running",
  87. "inputTokens": 80,
  88. "outputTokens": 4,
  89. "text": "QUEUED_COMMAND_RESTART_STREAMING"
  90. }
  91. }
  92. }
  93. ]
  94. }