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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-plan-session-switch-restore",
  4. "spec": "./test/e2e/conversation-session/planning/conversation-session-plan-session-switch-restore.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-plan-session-switch-restore-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy fixture 或触发后台网络重试。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-conversation-plan-session-switch-enter",
  31. "description": "首轮请求返回 EnterPlanMode,建立计划模式前置状态。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "稳定进入 plan mode,避免依赖真实模型是否选择 EnterPlanMode。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_PLAN_SESSION_SWITCH_RESTORE"],
  43. "bodyIncludes": [
  44. "E2E_PLAN_SESSION_SWITCH_RESTORE",
  45. "E2E_PLAN_SESSION_SWITCH_ENTER",
  46. "E2E_PLAN_SESSION_SWITCH_EXIT"
  47. ],
  48. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "toolUse": {
  53. "id": "toolu_e2e_plan_session_switch_enter",
  54. "name": "EnterPlanMode",
  55. "input": {}
  56. }
  57. }
  58. },
  59. {
  60. "id": "upstream-conversation-plan-session-switch-exit-controlled-stream",
  61. "description": "发送真实 ExitPlanMode 部分参数后等待释放;测试切走后才补齐完整参数。 正文先提交可重试前奏,再逐段释放真实工具参数。",
  62. "metadata": {
  63. "kind": "main",
  64. "timingPolicy": "controlled-stream",
  65. "source": "synthetic",
  66. "syntheticReason": "稳定制造用户在 ExitPlanMode 参数生成期间切走、完整 tool call 在后台到达的恢复窗口。"
  67. },
  68. "maxMatches": 1,
  69. "match": {
  70. "method": "POST",
  71. "pathIncludes": "/messages",
  72. "bodyIncludes": [
  73. "E2E_PLAN_SESSION_SWITCH_EXIT",
  74. "E2E_PLAN_SESSION_SWITCH_RESTORED_BODY",
  75. "toolu_e2e_plan_session_switch_enter"
  76. ],
  77. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  78. },
  79. "response": {
  80. "statusCode": 200,
  81. "statusMessage": "OK",
  82. "headers": {
  83. "cache-control": "no-cache",
  84. "content-type": "text/event-stream; charset=utf-8"
  85. },
  86. "chunks": [
  87. {
  88. "offsetMs": 0,
  89. "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"
  90. },
  91. {
  92. "offsetMs": 1,
  93. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  94. },
  95. {
  96. "offsetMs": 2,
  97. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_PLAN_SESSION_SWITCH_PREVIEW\"}}\n\n"
  98. },
  99. {
  100. "offsetMs": 3,
  101. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  102. },
  103. {
  104. "offsetMs": 4,
  105. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_e2e_plan_session_switch_exit\",\"name\":\"ExitPlanMode\",\"input\":{}}}\n\n"
  106. },
  107. {
  108. "offsetMs": 5,
  109. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"plan\\\":\\\"\"}}\n\n"
  110. },
  111. {
  112. "offsetMs": 6,
  113. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"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"
  114. },
  115. {
  116. "offsetMs": 7,
  117. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\n"
  118. },
  119. {
  120. "offsetMs": 8,
  121. "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"
  122. },
  123. {
  124. "offsetMs": 9,
  125. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  126. }
  127. ],
  128. "releaseAfterChunks": 6
  129. }
  130. }
  131. ]
  132. }