| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- {
- "version": 1,
- "caseName": "conversation-session-ttft-diagnostics",
- "spec": "./test/e2e/conversation-session/telemetry/conversation-session-ttft-diagnostics.test.ts",
- "fixtures": [
- {
- "id": "ttft-diag-title",
- "metadata": {
- "kind": "common",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "隔离标题生成,不让无关后台请求产生 Missing Fixture 重试与性能噪音。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_TTFT_"]
- },
- "response": {
- "statusCode": 200,
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"diag-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"TTFT diagnostics\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":30,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":10,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "ttft-diag-hold",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_HOLD"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 8000,
- "text": {
- "id": "ttft-diag-hold",
- "text": "ttft-diag-hold-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-queue",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_QUEUE"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 700,
- "text": {
- "id": "ttft-diag-queue",
- "text": "ttft-diag-queue-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-cancel",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_CANCEL"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 15000,
- "text": {
- "id": "ttft-diag-cancel",
- "text": "ttft-diag-cancel-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-retry-failure",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_RETRY"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 503,
- "headers": {
- "content-type": "application/json"
- },
- "body": "{\"type\": \"error\", \"error\": {\"type\": \"overloaded_error\", \"message\": \"Synthetic retry\"}}"
- }
- },
- {
- "id": "ttft-diag-retry-success",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_RETRY"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "ttft-diag-retry",
- "text": "ttft-diag-retry-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-fail",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_FAIL"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 400,
- "headers": {
- "content-type": "application/json"
- },
- "body": "{\"type\": \"error\", \"error\": {\"type\": \"invalid_request_error\", \"message\": \"Synthetic permanent failure\"}}"
- }
- },
- {
- "id": "ttft-diag-guide-read",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_GUIDE_PARENT"],
- "bodyExcludes": ["Generate a concise title", "E2E_TTFT_GUIDE_FILE"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 4000,
- "toolUse": {
- "id": "ttft-diag-read",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/ttft-diagnostics/input.txt"
- }
- }
- }
- },
- {
- "id": "ttft-diag-guide-final",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": ["Generate a concise title"],
- "bodyIncludes": ["E2E_TTFT_GUIDE_FILE", "E2E_TTFT_DIAG_GUIDE_INPUT", "tool_result"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "guide-final",
- "text": "ttft-diag-guide-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-pause",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_PAUSE"],
- "bodyExcludes": ["Generate a concise title"],
- "lastUserMessageExcludes": ["E2E_TTFT_DIAG_CONFIRM", "E2E_TTFT_DIAG_HELD"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 15000,
- "text": {
- "id": "pause",
- "text": "ttft-diag-pause-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- },
- "description": "停止可能早于 provider 请求,PAUSE 未消费时不能抢匹配随后合并的 CONFIRM/HELD user content。"
- },
- {
- "id": "ttft-diag-held",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_HELD"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 300,
- "text": {
- "id": "held",
- "text": "ttft-diag-held-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- },
- {
- "id": "ttft-diag-confirm",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_TTFT_DIAG_CONFIRM"],
- "bodyExcludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 300,
- "text": {
- "id": "confirm",
- "text": "ttft-diag-confirm-ok",
- "inputTokens": 80,
- "outputTokens": 10
- }
- }
- }
- ]
- }
|