conversation-session-output-limit-continue-ui.json 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-output-limit-continue-ui",
  4. "spec": "./test/e2e/conversation-session/conversation-session-output-limit-continue-ui.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "output-limit-continue-ui-title",
  8. "description": "OTC08 标题 sidecar 固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不是 Continue UI 现状探针的产品语义;固定响应避免干扰三次主请求。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_OUTPUT_LIMIT_CONTINUE_UI"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "output-limit-continue-ui-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"Continue UI Probe\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "output-limit-continue-ui-partial-p1",
  32. "description": "第一次主请求在同一自然段的句中位置返回 p1 并以 max_tokens 截断。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "确定性制造无标题、无换段的第一段句中截断正文,观察 Continue 后的 Desktop 投影。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_UI"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "statusMessage": "OK",
  49. "headers": {
  50. "cache-control": "no-cache",
  51. "content-type": "text/event-stream; charset=utf-8"
  52. },
  53. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"output-limit-continue-ui-partial-p1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":12,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"当一个回答因为输出上限被截断时,用户真正关心的并不是底层又发起了几次模型请求,而是阅读体验能否保持连贯。理想情况下,系统会保留已经生成的内容,在本轮内部补充一条继续指令,并让模型从刚才停下的位置直接往后写;从用户视角看,这一切应该仍然是一段自然展开的说明,即使底层已经\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"max_tokens\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":12,\"output_tokens\":8}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  54. }
  55. },
  56. {
  57. "id": "output-limit-continue-ui-partial-p2",
  58. "description": "第二次主请求直接接续 p1,并在同一自然段的另一句中位置再次以 max_tokens 截断。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "确定性制造无标题、无换段且直接接续 p1 的第二段句中截断正文,观察相邻 partial 的 Desktop 分块。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_UI"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "statusMessage": "OK",
  75. "headers": {
  76. "cache-control": "no-cache",
  77. "content-type": "text/event-stream; charset=utf-8"
  78. },
  79. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"output-limit-continue-ui-partial-p2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":20,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"发起了新的 provider 请求,页面也不应该出现重新问候、重复总结或额外的 Continue 提示,而应该无缝接上前面的主语和谓语,继续解释剩余部分。为了确认这种连续性在多次触顶时也成立,这个测试还会让第二次输出继续写一段,然后故意在另一个尚未结束的短语中停住,例如这里再让句子停在\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"max_tokens\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":20,\"output_tokens\":8}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  80. }
  81. },
  82. {
  83. "id": "output-limit-continue-ui-final-p3",
  84. "description": "第三次主请求直接接续 p2、补完同一自然段并正常 end_turn。",
  85. "metadata": {
  86. "kind": "main",
  87. "timingPolicy": "fast-text",
  88. "source": "synthetic",
  89. "syntheticReason": "以无标题、无换段且直接接续 p2 的正文正常结束恢复链,供 Desktop 展示最终 assistant 段。"
  90. },
  91. "maxMatches": 1,
  92. "match": {
  93. "method": "POST",
  94. "pathIncludes": "/messages",
  95. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_UI"],
  96. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  97. },
  98. "response": {
  99. "statusCode": 200,
  100. "statusMessage": "OK",
  101. "headers": {
  102. "cache-control": "no-cache",
  103. "content-type": "text/event-stream; charset=utf-8"
  104. },
  105. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"output-limit-continue-ui-final-p3\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":28,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"一个尚未完成的位置,最后一次请求则从这个宾语开始补全句意,并自然收束整个回答。若最终页面读起来仍像一次完整输出,而不是三次独立回复,就说明 Continue 已经被正确限制在 agent loop 内部,外部只需感知一条持续增长的 assistant 内容。\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":28,\"output_tokens\":8}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  106. }
  107. }
  108. ]
  109. }