conversation-session-output-limit-continue-markdown-protocols.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-output-limit-continue-markdown-protocols",
  4. "spec": "./test/e2e/conversation-session/presentation/conversation-session-output-limit-continue-markdown-protocols.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "otc11-chat-title",
  8. "description": "Chat Completions 子用例标题 sidecar 固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于 Continue 协议归一化探针,固定响应避免占用四次主请求 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS",
  21. "OTC11_CHAT_COMPLETIONS"
  22. ]
  23. },
  24. "response": {
  25. "statusCode": 200,
  26. "headers": {
  27. "content-type": "application/json; charset=utf-8"
  28. },
  29. "body": "{\"id\":\"otc11-chat-title\",\"object\":\"chat.completion\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"OTC11 Chat Protocol\\\"}\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":4,\"total_tokens\":14}}"
  30. }
  31. },
  32. {
  33. "id": "otc11-chat-partial-p1",
  34. "description": "Chat Completions p1 以标准 finish_reason=length 截断。",
  35. "metadata": {
  36. "kind": "main",
  37. "timingPolicy": "fast-text",
  38. "source": "synthetic",
  39. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第一条 Continue 并保留 Markdown 拼接缝。"
  40. },
  41. "maxMatches": 1,
  42. "match": {
  43. "method": "POST",
  44. "pathIncludes": "/chat/completions",
  45. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  46. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  47. },
  48. "response": {
  49. "statusCode": 200,
  50. "headers": {
  51. "content-type": "text/event-stream; charset=utf-8"
  52. },
  53. "body": "data: {\"id\":\"otc11-chat-p1\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"## Continue Markdown 全量边界\\n\\n首段包含 **粗体边界**、*斜体边界*、~~删除线边界~~ 与 `inline-boundary`。\\n\\n- [x] 已完成任务\\n- [ ] **带跨缝[链接\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"otc11-chat-p1\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"length\"}]}\n\ndata: {\"id\":\"otc11-chat-p1\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[],\"usage\":{\"prompt_tokens\":12,\"completion_tokens\":8,\"total_tokens\":20}}\n\ndata: [DONE]\n\n"
  54. }
  55. },
  56. {
  57. "id": "otc11-chat-partial-p2",
  58. "description": "Chat Completions p2 以标准 finish_reason=length 截断。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第二条 Continue。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/chat/completions",
  69. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "headers": {
  75. "content-type": "text/event-stream; charset=utf-8"
  76. },
  77. "body": "data: {\"id\":\"otc11-chat-p2\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"](https://example.com/continue-edge)** 保持完整\\n- 普通 bullet 在 Continue 中保留\\n\\n1. *~~有序项中的图片 ![跨缝图片\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"otc11-chat-p2\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"length\"}]}\n\ndata: {\"id\":\"otc11-chat-p2\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[],\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":8,\"total_tokens\":28}}\n\ndata: [DONE]\n\n"
  78. }
  79. },
  80. {
  81. "id": "otc11-chat-partial-p3",
  82. "description": "Chat Completions p3 以标准 finish_reason=length 截断。",
  83. "metadata": {
  84. "kind": "main",
  85. "timingPolicy": "fast-text",
  86. "source": "synthetic",
  87. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第三条 Continue。"
  88. },
  89. "maxMatches": 1,
  90. "match": {
  91. "method": "POST",
  92. "pathIncludes": "/chat/completions",
  93. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  94. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  95. },
  96. "response": {
  97. "statusCode": 200,
  98. "headers": {
  99. "content-type": "text/event-stream; charset=utf-8"
  100. },
  101. "body": "data: {\"id\":\"otc11-chat-p3\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"](.zcode-e2e/continue-markdown-protocols/cross-seam.svg)~~* 保持完整\\n2. 第二个有序项\\n\\n| 来源 | 结果 |\\n| --- | --- |\\n| p3 | p4 |\\n\\n---\\n\\n```ts\\nconst beforeBoundary = \\\"P3\\\";\\n\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"otc11-chat-p3\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"length\"}]}\n\ndata: {\"id\":\"otc11-chat-p3\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[],\"usage\":{\"prompt_tokens\":28,\"completion_tokens\":8,\"total_tokens\":36}}\n\ndata: [DONE]\n\n"
  102. }
  103. },
  104. {
  105. "id": "otc11-chat-final-p4",
  106. "description": "Chat Completions p4 以 finish_reason=stop 正常结束。",
  107. "metadata": {
  108. "kind": "main",
  109. "timingPolicy": "fast-text",
  110. "source": "synthetic",
  111. "syntheticReason": "正常结束 Chat Completions Continue 链并提供最终累计 Markdown DOM。"
  112. },
  113. "maxMatches": 1,
  114. "match": {
  115. "method": "POST",
  116. "pathIncludes": "/chat/completions",
  117. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  118. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  119. },
  120. "response": {
  121. "statusCode": 200,
  122. "headers": {
  123. "content-type": "text/event-stream; charset=utf-8"
  124. },
  125. "body": "data: {\"id\":\"otc11-chat-p4\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"const afterBoundary = \\\"P4\\\";\\nconsole.log(beforeBoundary + afterBoundary);\\n```\\n\\n> 围栏闭合后的引用仍然正常。\\n\\n硬换行第一行 \\n硬换行第二行。\\n\\n行内公式 $E = mc^2$。\\n\\n$$\\na^2 + b^2 = c^2\\n$$\\n\\n```mermaid\\ngraph TD\\n A[Continue] --> B[One assistant]\\n```\\n\\n自动链接 <https://example.com/autolink>\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"otc11-chat-p4\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: {\"id\":\"otc11-chat-p4\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[],\"usage\":{\"prompt_tokens\":36,\"completion_tokens\":12,\"total_tokens\":48}}\n\ndata: [DONE]\n\n"
  126. }
  127. },
  128. {
  129. "id": "otc11-responses-title",
  130. "description": "Responses API 子用例标题 sidecar 固定响应。",
  131. "metadata": {
  132. "kind": "common",
  133. "timingPolicy": "fast-text",
  134. "source": "synthetic",
  135. "syntheticReason": "标题不属于 Continue 协议归一化探针,固定响应避免占用四次主请求 fixture。"
  136. },
  137. "match": {
  138. "method": "POST",
  139. "pathIncludes": "/responses",
  140. "bodyIncludes": [
  141. "Generate a concise title",
  142. "E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS",
  143. "OTC11_RESPONSES_API"
  144. ]
  145. },
  146. "response": {
  147. "statusCode": 200,
  148. "headers": {
  149. "content-type": "application/json; charset=utf-8"
  150. },
  151. "body": "{\"id\":\"otc11-responses-title\",\"created_at\":1,\"model\":\"otc-protocol-responses\",\"service_tier\":null,\"incomplete_details\":null,\"usage\":{\"input_tokens\":10,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":4,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"object\":\"response\",\"status\":\"completed\",\"error\":null,\"output\":[{\"id\":\"otc11-responses-title-message\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"{\\\"title\\\":\\\"OTC11 Responses Protocol\\\"}\",\"annotations\":[]}]}]}"
  152. }
  153. },
  154. {
  155. "id": "otc11-responses-partial-p1",
  156. "description": "Responses p1 以 response.incomplete/max_output_tokens 截断。",
  157. "metadata": {
  158. "kind": "main",
  159. "timingPolicy": "fast-text",
  160. "source": "synthetic",
  161. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会归一化为 length 并触发第一条 Continue。"
  162. },
  163. "maxMatches": 1,
  164. "match": {
  165. "method": "POST",
  166. "pathIncludes": "/responses",
  167. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  168. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  169. },
  170. "response": {
  171. "statusCode": 200,
  172. "headers": {
  173. "content-type": "text/event-stream; charset=utf-8"
  174. },
  175. "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"otc11-responses-p1\",\"created_at\":1,\"model\":\"otc-protocol-responses\",\"service_tier\":null}}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p1-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"otc11-responses-p1-message\",\"delta\":\"## Continue Markdown 全量边界\\n\\n首段包含 **粗体边界**、*斜体边界*、~~删除线边界~~ 与 `inline-boundary`。\\n\\n- [x] 已完成任务\\n- [ ] **带跨缝[链接\"}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p1-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.incomplete\",\"response\":{\"incomplete_details\":{\"reason\":\"max_output_tokens\"},\"usage\":{\"input_tokens\":12,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":8,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"service_tier\":null}}\n\ndata: [DONE]\n\n"
  176. }
  177. },
  178. {
  179. "id": "otc11-responses-partial-p2",
  180. "description": "Responses p2 以 response.incomplete/max_output_tokens 截断。",
  181. "metadata": {
  182. "kind": "main",
  183. "timingPolicy": "fast-text",
  184. "source": "synthetic",
  185. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会触发第二条 Continue。"
  186. },
  187. "maxMatches": 1,
  188. "match": {
  189. "method": "POST",
  190. "pathIncludes": "/responses",
  191. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  192. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  193. },
  194. "response": {
  195. "statusCode": 200,
  196. "headers": {
  197. "content-type": "text/event-stream; charset=utf-8"
  198. },
  199. "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"otc11-responses-p2\",\"created_at\":1,\"model\":\"otc-protocol-responses\",\"service_tier\":null}}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p2-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"otc11-responses-p2-message\",\"delta\":\"](https://example.com/continue-edge)** 保持完整\\n- 普通 bullet 在 Continue 中保留\\n\\n1. *~~有序项中的图片 ![跨缝图片\"}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p2-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.incomplete\",\"response\":{\"incomplete_details\":{\"reason\":\"max_output_tokens\"},\"usage\":{\"input_tokens\":20,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":8,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"service_tier\":null}}\n\ndata: [DONE]\n\n"
  200. }
  201. },
  202. {
  203. "id": "otc11-responses-partial-p3",
  204. "description": "Responses p3 以 response.incomplete/max_output_tokens 截断。",
  205. "metadata": {
  206. "kind": "main",
  207. "timingPolicy": "fast-text",
  208. "source": "synthetic",
  209. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会触发第三条 Continue。"
  210. },
  211. "maxMatches": 1,
  212. "match": {
  213. "method": "POST",
  214. "pathIncludes": "/responses",
  215. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  216. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  217. },
  218. "response": {
  219. "statusCode": 200,
  220. "headers": {
  221. "content-type": "text/event-stream; charset=utf-8"
  222. },
  223. "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"otc11-responses-p3\",\"created_at\":1,\"model\":\"otc-protocol-responses\",\"service_tier\":null}}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p3-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"otc11-responses-p3-message\",\"delta\":\"](.zcode-e2e/continue-markdown-protocols/cross-seam.svg)~~* 保持完整\\n2. 第二个有序项\\n\\n| 来源 | 结果 |\\n| --- | --- |\\n| p3 | p4 |\\n\\n---\\n\\n```ts\\nconst beforeBoundary = \\\"P3\\\";\\n\"}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p3-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.incomplete\",\"response\":{\"incomplete_details\":{\"reason\":\"max_output_tokens\"},\"usage\":{\"input_tokens\":28,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":8,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"service_tier\":null}}\n\ndata: [DONE]\n\n"
  224. }
  225. },
  226. {
  227. "id": "otc11-responses-final-p4",
  228. "description": "Responses p4 以 response.completed 正常结束。",
  229. "metadata": {
  230. "kind": "main",
  231. "timingPolicy": "fast-text",
  232. "source": "synthetic",
  233. "syntheticReason": "正常结束 Responses Continue 链并提供最终累计 Markdown DOM。"
  234. },
  235. "maxMatches": 1,
  236. "match": {
  237. "method": "POST",
  238. "pathIncludes": "/responses",
  239. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  240. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  241. },
  242. "response": {
  243. "statusCode": 200,
  244. "headers": {
  245. "content-type": "text/event-stream; charset=utf-8"
  246. },
  247. "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"otc11-responses-p4\",\"created_at\":1,\"model\":\"otc-protocol-responses\",\"service_tier\":null}}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p4-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"otc11-responses-p4-message\",\"delta\":\"const afterBoundary = \\\"P4\\\";\\nconsole.log(beforeBoundary + afterBoundary);\\n```\\n\\n> 围栏闭合后的引用仍然正常。\\n\\n硬换行第一行 \\n硬换行第二行。\\n\\n行内公式 $E = mc^2$。\\n\\n$$\\na^2 + b^2 = c^2\\n$$\\n\\n```mermaid\\ngraph TD\\n A[Continue] --> B[One assistant]\\n```\\n\\n自动链接 <https://example.com/autolink>\"}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-p4-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"incomplete_details\":null,\"usage\":{\"input_tokens\":36,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":12,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"service_tier\":null}}\n\ndata: [DONE]\n\n"
  248. }
  249. }
  250. ]
  251. }