conversation-session-plan-session-switch-restore.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-plan-session-switch-restore",
  4. "spec": "./test/e2e/conversation-session/conversation-session-plan-session-switch-restore.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-conversation-plan-session-switch-enter",
  8. "description": "首轮请求返回 EnterPlanMode,建立计划模式前置状态。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "稳定进入 plan mode,避免依赖真实模型是否选择 EnterPlanMode。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "lastUserMessageIncludes": ["E2E_PLAN_SESSION_SWITCH_RESTORE"],
  20. "bodyIncludes": [
  21. "E2E_PLAN_SESSION_SWITCH_RESTORE",
  22. "E2E_PLAN_SESSION_SWITCH_ENTER",
  23. "E2E_PLAN_SESSION_SWITCH_EXIT"
  24. ],
  25. "bodyExcludes": [
  26. "Generate a concise title",
  27. "CRITICAL: Respond with TEXT ONLY"
  28. ]
  29. },
  30. "response": {
  31. "statusCode": 200,
  32. "toolUse": {
  33. "id": "toolu_e2e_plan_session_switch_enter",
  34. "name": "EnterPlanMode",
  35. "input": {}
  36. }
  37. }
  38. },
  39. {
  40. "id": "upstream-conversation-plan-session-switch-exit-controlled-stream",
  41. "description": "先发送 ExitPlanMode tool_input_start,8 秒后再完成 plan 参数和 tool_use。",
  42. "metadata": {
  43. "kind": "main",
  44. "timingPolicy": "controlled-stream",
  45. "source": "synthetic",
  46. "syntheticReason": "稳定制造用户在 ExitPlanMode 参数生成期间切走、完整 tool call 在后台到达的恢复窗口。"
  47. },
  48. "maxMatches": 1,
  49. "match": {
  50. "method": "POST",
  51. "pathIncludes": "/messages",
  52. "bodyIncludes": [
  53. "E2E_PLAN_SESSION_SWITCH_EXIT",
  54. "E2E_PLAN_SESSION_SWITCH_RESTORED_BODY",
  55. "toolu_e2e_plan_session_switch_enter"
  56. ],
  57. "bodyExcludes": [
  58. "Generate a concise title",
  59. "CRITICAL: Respond with TEXT ONLY"
  60. ]
  61. },
  62. "response": {
  63. "statusCode": 200,
  64. "statusMessage": "OK",
  65. "headers": {
  66. "cache-control": "no-cache",
  67. "content-type": "text/event-stream; charset=utf-8"
  68. },
  69. "chunks": [
  70. {
  71. "offsetMs": 0,
  72. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-plan-session-switch-exit\",\"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\n"
  73. },
  74. {
  75. "offsetMs": 100,
  76. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_e2e_plan_session_switch_exit\",\"name\":\"ExitPlanMode\",\"input\":{}}}\n\n"
  77. },
  78. {
  79. "offsetMs": 200,
  80. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"plan\\\":\\\"\"}}\n\n"
  81. },
  82. {
  83. "offsetMs": 8000,
  84. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"E2E_PLAN_SESSION_SWITCH_RESTORED_BODY: 1. Hydrate the persisted plan. 2. Keep the task waiting for approval. 3. Verify before stop.\\\",\\\"allowedPrompts\\\":[]}\"}}\n\n"
  85. },
  86. {
  87. "offsetMs": 8100,
  88. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  89. },
  90. {
  91. "offsetMs": 8200,
  92. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":24,\"service_tier\":\"standard\"}}\n\n"
  93. },
  94. {
  95. "offsetMs": 8300,
  96. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  97. }
  98. ]
  99. }
  100. }
  101. ]
  102. }