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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-output-limit-continue-markdown-protocols",
  4. "spec": "./test/e2e/conversation-session/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": { "content-type": "text/event-stream; charset=utf-8" },
  27. "body": "data: {\"id\":\"otc11-chat-title\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"{\\\"title\\\":\\\"OTC11 Chat Protocol\\\"}\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"otc11-chat-title\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: {\"id\":\"otc11-chat-title\",\"object\":\"chat.completion.chunk\",\"created\":1,\"model\":\"otc-protocol-chat\",\"choices\":[],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":4,\"total_tokens\":14}}\n\ndata: [DONE]\n\n"
  28. }
  29. },
  30. {
  31. "id": "otc11-chat-partial-p1",
  32. "description": "Chat Completions p1 以标准 finish_reason=length 截断。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第一条 Continue 并保留 Markdown 拼接缝。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/chat/completions",
  43. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  49. "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"
  50. }
  51. },
  52. {
  53. "id": "otc11-chat-partial-p2",
  54. "description": "Chat Completions p2 以标准 finish_reason=length 截断。",
  55. "metadata": {
  56. "kind": "main",
  57. "timingPolicy": "fast-text",
  58. "source": "synthetic",
  59. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第二条 Continue。"
  60. },
  61. "maxMatches": 1,
  62. "match": {
  63. "method": "POST",
  64. "pathIncludes": "/chat/completions",
  65. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  66. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  67. },
  68. "response": {
  69. "statusCode": 200,
  70. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  71. "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"
  72. }
  73. },
  74. {
  75. "id": "otc11-chat-partial-p3",
  76. "description": "Chat Completions p3 以标准 finish_reason=length 截断。",
  77. "metadata": {
  78. "kind": "main",
  79. "timingPolicy": "fast-text",
  80. "source": "synthetic",
  81. "syntheticReason": "确定性证明 Chat Completions 标准 length 会触发第三条 Continue。"
  82. },
  83. "maxMatches": 1,
  84. "match": {
  85. "method": "POST",
  86. "pathIncludes": "/chat/completions",
  87. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  88. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  89. },
  90. "response": {
  91. "statusCode": 200,
  92. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  93. "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"
  94. }
  95. },
  96. {
  97. "id": "otc11-chat-final-p4",
  98. "description": "Chat Completions p4 以 finish_reason=stop 正常结束。",
  99. "metadata": {
  100. "kind": "main",
  101. "timingPolicy": "fast-text",
  102. "source": "synthetic",
  103. "syntheticReason": "正常结束 Chat Completions Continue 链并提供最终累计 Markdown DOM。"
  104. },
  105. "maxMatches": 1,
  106. "match": {
  107. "method": "POST",
  108. "pathIncludes": "/chat/completions",
  109. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_CHAT_COMPLETIONS"],
  110. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  111. },
  112. "response": {
  113. "statusCode": 200,
  114. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  115. "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"
  116. }
  117. },
  118. {
  119. "id": "otc11-responses-title",
  120. "description": "Responses API 子用例标题 sidecar 固定响应。",
  121. "metadata": {
  122. "kind": "common",
  123. "timingPolicy": "fast-text",
  124. "source": "synthetic",
  125. "syntheticReason": "标题不属于 Continue 协议归一化探针,固定响应避免占用四次主请求 fixture。"
  126. },
  127. "match": {
  128. "method": "POST",
  129. "pathIncludes": "/responses",
  130. "bodyIncludes": [
  131. "Generate a concise title",
  132. "E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS",
  133. "OTC11_RESPONSES_API"
  134. ]
  135. },
  136. "response": {
  137. "statusCode": 200,
  138. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  139. "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"otc11-responses-title\",\"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-title-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"otc11-responses-title-message\",\"delta\":\"{\\\"title\\\":\\\"OTC11 Responses Protocol\\\"}\"}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"otc11-responses-title-message\",\"phase\":\"final_answer\"}}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"incomplete_details\":null,\"usage\":{\"input_tokens\":10,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":4,\"output_tokens_details\":{\"reasoning_tokens\":0}},\"service_tier\":null}}\n\ndata: [DONE]\n\n"
  140. }
  141. },
  142. {
  143. "id": "otc11-responses-partial-p1",
  144. "description": "Responses p1 以 response.incomplete/max_output_tokens 截断。",
  145. "metadata": {
  146. "kind": "main",
  147. "timingPolicy": "fast-text",
  148. "source": "synthetic",
  149. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会归一化为 length 并触发第一条 Continue。"
  150. },
  151. "maxMatches": 1,
  152. "match": {
  153. "method": "POST",
  154. "pathIncludes": "/responses",
  155. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  156. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  157. },
  158. "response": {
  159. "statusCode": 200,
  160. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  161. "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"
  162. }
  163. },
  164. {
  165. "id": "otc11-responses-partial-p2",
  166. "description": "Responses p2 以 response.incomplete/max_output_tokens 截断。",
  167. "metadata": {
  168. "kind": "main",
  169. "timingPolicy": "fast-text",
  170. "source": "synthetic",
  171. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会触发第二条 Continue。"
  172. },
  173. "maxMatches": 1,
  174. "match": {
  175. "method": "POST",
  176. "pathIncludes": "/responses",
  177. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  178. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  179. },
  180. "response": {
  181. "statusCode": 200,
  182. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  183. "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"
  184. }
  185. },
  186. {
  187. "id": "otc11-responses-partial-p3",
  188. "description": "Responses p3 以 response.incomplete/max_output_tokens 截断。",
  189. "metadata": {
  190. "kind": "main",
  191. "timingPolicy": "fast-text",
  192. "source": "synthetic",
  193. "syntheticReason": "确定性证明 Responses 标准 incomplete reason 会触发第三条 Continue。"
  194. },
  195. "maxMatches": 1,
  196. "match": {
  197. "method": "POST",
  198. "pathIncludes": "/responses",
  199. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  200. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  201. },
  202. "response": {
  203. "statusCode": 200,
  204. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  205. "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"
  206. }
  207. },
  208. {
  209. "id": "otc11-responses-final-p4",
  210. "description": "Responses p4 以 response.completed 正常结束。",
  211. "metadata": {
  212. "kind": "main",
  213. "timingPolicy": "fast-text",
  214. "source": "synthetic",
  215. "syntheticReason": "正常结束 Responses Continue 链并提供最终累计 Markdown DOM。"
  216. },
  217. "maxMatches": 1,
  218. "match": {
  219. "method": "POST",
  220. "pathIncludes": "/responses",
  221. "bodyIncludes": ["E2E_OUTPUT_LIMIT_CONTINUE_MARKDOWN_PROTOCOLS", "OTC11_RESPONSES_API"],
  222. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  223. },
  224. "response": {
  225. "statusCode": 200,
  226. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  227. "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"
  228. }
  229. }
  230. ]
  231. }