{ "version": 1, "caseName": "conversation-session-stop-empty", "spec": "./test/e2e/conversation-session/execution/conversation-session-stop-empty.test.ts", "fixtures": [ { "id": "conversation-session-stop-empty-title-sidecar", "description": "本例标题旁路响应。", "metadata": { "kind": "common", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy fixture 或触发后台网络重试。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["Generate a concise title"] }, "response": { "statusCode": 200, "statusMessage": "OK", "headers": { "content-type": "application/json; charset=utf-8" }, "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\"}}" } }, { "id": "upstream-stop-empty-running-slow-stream", "description": "Stop empty queue 首轮慢流,稳定制造 queue=0 的 running 窗口。", "metadata": { "kind": "main", "timingPolicy": "controlled-stream", "source": "synthetic", "syntheticReason": "stop 空队列语义只依赖当前轮保持 running;真实 provider 可能过快完成导致 stop 按钮窗口消失。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_STOP_EMPTY_RUNNING"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_STOP_EMPTY_RUNNING"] }, "response": { "statusCode": 200, "statusMessage": "OK", "headers": { "cache-control": "no-cache", "content-type": "text/event-stream; charset=utf-8" }, "events": [ { "sequence": 0, "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-empty-running-slow-stream\",\"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" }, { "sequence": 1, "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" }, { "sequence": 2, "offsetMs": 700, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n" }, { "sequence": 3, "offsetMs": 60000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n" }, { "sequence": 4, "offsetMs": 60100, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" }, { "sequence": 5, "offsetMs": 60200, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n" }, { "sequence": 6, "offsetMs": 60300, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } ] } }, { "id": "upstream-stop-empty-next-fast-text", "description": "Stop empty queue 后续普通文本应立即启动并完成。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "核心断言是 stop 后 queue=0 不阻塞下一轮;响应只需稳定完成。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_STOP_EMPTY_NEXT"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_STOP_EMPTY_NEXT"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-stop-empty-next", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-stop-empty-toolcall-bash", "description": "Stop empty queue 的 tool call 运行窗口:返回一个长时间 Bash tool_use。用 sh -c 包一层:第一个子命令是 sleep 25 秒以上的前台命令会在执行前被拒绝。", "metadata": { "kind": "main", "timingPolicy": "fast-tool-use", "source": "synthetic", "syntheticReason": "tool call 运行中 stop 后再发需要稳定制造本地工具执行窗口,真实模型可能选择纯文本或过快完成。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_STOP_EMPTY_TOOLCALL_RUNNING"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_STOP_EMPTY_TOOLCALL_RUNNING"] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_stop_empty_toolcall_bash", "name": "Bash", "input": { "command": "sh -c 'sleep 60'", "description": "E2E stop empty long Bash" } } } }, { "id": "upstream-stop-empty-toolcall-next-fast-text", "description": "Tool call stop 后续普通文本应立即启动并完成。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "核心断言是 tool call stop 后 queue=0 不阻塞下一轮;响应只需稳定完成。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_STOP_EMPTY_TOOLCALL_NEXT"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_STOP_EMPTY_TOOLCALL_NEXT"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-stop-empty-toolcall-next", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } } ] }