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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-queued-command-restart",
  4. "spec": "./test/e2e/conversation-session/queue/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": ["Generate a concise title", "E2E_QUEUED_COMMAND_RESTART_RUNNING"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"queued-command-restart-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Queued Command Restart E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
  26. }
  27. },
  28. {
  29. "id": "queued-command-restart-running-turn",
  30. "description": "PV4-25Q controlled stream:保持首轮 running,让第二条输入真实进入 CLI queue。",
  31. "metadata": {
  32. "kind": "main",
  33. "timingPolicy": "controlled-stream",
  34. "source": "synthetic",
  35. "syntheticReason": "只有 running 窗口才能形成 delivery=queue 的 durable session_input;随后由整进程重启真实转成 discarded。"
  36. },
  37. "maxMatches": 1,
  38. "match": {
  39. "method": "POST",
  40. "pathIncludes": "/messages",
  41. "lastUserMessageIncludes": ["E2E_QUEUED_COMMAND_RESTART_RUNNING"],
  42. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  43. },
  44. "response": {
  45. "statusCode": 200,
  46. "statusMessage": "OK",
  47. "headers": {
  48. "cache-control": "no-cache",
  49. "content-type": "text/event-stream; charset=utf-8"
  50. },
  51. "chunks": [
  52. {
  53. "offsetMs": 0,
  54. "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"
  55. },
  56. {
  57. "offsetMs": 250,
  58. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  59. },
  60. {
  61. "offsetMs": 500,
  62. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"QUEUED_COMMAND_RESTART_STREAMING \"}}\n\n"
  63. },
  64. {
  65. "offsetMs": 45000,
  66. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  67. },
  68. {
  69. "offsetMs": 45100,
  70. "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"
  71. },
  72. {
  73. "offsetMs": 45200,
  74. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  75. }
  76. ],
  77. "text": {
  78. "id": "queued-command-restart-running",
  79. "inputTokens": 80,
  80. "outputTokens": 4,
  81. "text": "QUEUED_COMMAND_RESTART_STREAMING"
  82. }
  83. }
  84. }
  85. ]
  86. }