| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553 |
- {
- "version": 1,
- "caseName": "conversation-session-running-guide-steer",
- "spec": "./test/e2e/conversation-session/execution/conversation-session-running-guide-steer.test.ts",
- "fixtures": [
- {
- "id": "upstream-running-guide-timeline-restored",
- "description": "P06 cold restore and model capability switch preserve guide history.",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "真实 Electron/CLI 冷恢复后切换 endpoint 能力,检查原始 guide 重新投影且无重复包装。"
- },
- "maxMatches": 2,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_GUIDE_TIMELINE_RESTORED"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "text": "guide-timeline-restored-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-timeline-title",
- "description": "P06 title request returns immediately without competing with the three main timeline requests.",
- "metadata": {
- "kind": "common",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "标题不属于 P06 steer 时序,只需稳定返回,避免后台重试给 provider 记录和运行日志引入噪声。"
- },
- "maxMatches": 2,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_GUIDE_TIMELINE_BASE"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-running-guide-timeline-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Guide Timeline E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "upstream-running-guide-timeline-initial-read",
- "description": "P06/GTB-01: delay the initial Read tool_use so guide-1 is admitted before the tool result batch.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "guide-1 必须稳定进入首轮 active request,并等待 Read tool result batch 完整提交后 drain。"
- },
- "maxMatches": 2,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_GUIDE_TIMELINE_BASE"],
- "bodyExcludes": [
- "E2E_GUIDE_TIMELINE_GUIDE_ONE",
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_GUIDE_TIMELINE_BASE"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 5000,
- "toolUse": {
- "id": "toolu_e2e_running_guide_timeline_read",
- "messageId": "msg_e2e_running_guide_timeline_read",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/shared/readonly-tool.txt"
- }
- }
- }
- },
- {
- "id": "upstream-running-guide-timeline-middle-text",
- "description": "P06/GTB-01: after Read result + guide-1, delay a text-only assistant so guide-2 can be admitted.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "guide-2 需要稳定进入 guide-1 后的 text-only active request,并等待 assistant 正常收口后 drain。 验证来源提示及非用户授权边界。"
- },
- "maxMatches": 2,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GUIDE_TIMELINE_BASE",
- "E2E_GUIDE_TIMELINE_GUIDE_ONE",
- "E2E_READONLY_TOOL_FILE_CONTENT",
- "The user sent a new message while you were working:",
- "This is how ZCode surfaces messages the user sends mid-turn"
- ],
- "bodyExcludes": [
- "E2E_GUIDE_TIMELINE_GUIDE_TWO",
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_READONLY_TOOL_FILE_CONTENT"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 5000,
- "text": {
- "id": "upstream-e2e-running-guide-timeline-middle",
- "inputTokens": 180,
- "outputTokens": 16,
- "text": "E2E_GUIDE_TIMELINE_MIDDLE_ASSISTANT"
- }
- }
- },
- {
- "id": "upstream-running-guide-timeline-final-text",
- "description": "P06/GTB-04: text-only completion drains guide-2 and the same product turn returns its final assistant.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "固定最终正文 marker,用于直接断言两条 guide、三个工作段与最终 assistant 的 live DOM 全序。 验证来源提示及非用户授权边界。"
- },
- "maxMatches": 2,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GUIDE_TIMELINE_GUIDE_TWO",
- "E2E_GUIDE_TIMELINE_MIDDLE_ASSISTANT",
- "This is how ZCode surfaces messages the user sends mid-turn"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_GUIDE_TIMELINE_GUIDE_TWO"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-timeline-final",
- "inputTokens": 200,
- "outputTokens": 16,
- "text": "guide-timeline-final-assistant-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-batch-title",
- "description": "M06f title request returns immediately without competing with the main batch requests.",
- "metadata": {
- "kind": "common",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "标题不属于 M06f guide 时序,只需稳定返回,避免后台重试给 provider 记录引入噪声。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_GUIDE_BATCH_BASE"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-running-guide-batch-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Guide Batch E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "upstream-running-guide-batch-initial-read",
- "description": "M06f: delay the initial Read tool_use so both guides are admitted before the tool result batch.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "两条 guide 必须都在首轮 active request 内进入等待,再在同一个 Read tool result batch 后一起 drain。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_GUIDE_BATCH_BASE"],
- "bodyExcludes": [
- "E2E_GUIDE_BATCH_GUIDE_ONE",
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_GUIDE_BATCH_BASE"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 8000,
- "toolUse": {
- "id": "toolu_e2e_running_guide_batch_read",
- "messageId": "msg_e2e_running_guide_batch_read",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/shared/readonly-tool.txt"
- }
- }
- }
- },
- {
- "id": "upstream-running-guide-batch-final-text",
- "description": "M06f: the request after the Read batch carries both guides and completes the turn.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "只在同一请求同时带两条 guide 与 Read 结果时返回最终回答;逐条 drain 不会命中。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GUIDE_BATCH_GUIDE_ONE",
- "E2E_GUIDE_BATCH_GUIDE_TWO",
- "E2E_READONLY_TOOL_FILE_CONTENT"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-batch-final",
- "inputTokens": 200,
- "outputTokens": 16,
- "text": "guide-batch-final-assistant-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-steer-base-slow-stream",
- "description": "M06: guide 模式普通 running steer 的基础慢流。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "guide steer 需要稳定 running 窗口;真实 provider 可能过快完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_GUIDE_STEER_BASE"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_RUNNING_GUIDE_STEER_BASE"]
- },
- "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-running-guide-steer-base\",\"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": 5000,
- "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": 5100,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 5200,
- "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": 5300,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-running-guide-goal-seed-active",
- "description": "M06d: 在 active goal guide case 前建立稳定 session。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "goal guide case 只验证已建立 session 上的目标链路,避免 draft prewarm admission 混入状态窗口。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_GOAL_SEED_ACTIVE"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["E2E_RUNNING_GUIDE_GOAL_SEED_ACTIVE"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-goal-seed-active",
- "inputTokens": 80,
- "outputTokens": 8,
- "text": "running-guide-goal-seed-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-seed-verify",
- "description": "H11: 在 goal verifier guide case 前建立稳定 session。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "goal verifier guide case 只验证已建立 session 上的目标链路,避免 draft prewarm admission 混入状态窗口。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_GOAL_SEED_VERIFY"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["E2E_RUNNING_GUIDE_GOAL_SEED_VERIFY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-goal-seed-verify",
- "inputTokens": 80,
- "outputTokens": 8,
- "text": "running-guide-goal-seed-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-active-continuation-slow",
- "description": "M06d: guide 模式 active goal running 的 continuation 慢流。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "active goal guide steer 需要稳定 active target running 窗口。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_RUNNING_GUIDE_GOAL_ACTIVE",
- "Continue working toward the active session goal"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 5000,
- "text": {
- "id": "upstream-e2e-running-guide-goal-active",
- "inputTokens": 140,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-verify-continuation",
- "description": "H11: goal verifier queue case 前的 goal continuation。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "稳定让 guide 文本在 goal verifier running 窗口进入 future queue。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_RUNNING_GUIDE_GOAL_VERIFY",
- "Continue working toward the active session goal"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-goal-verify-continuation",
- "inputTokens": 140,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-verify-delayed",
- "description": "H11: delayed goal verifier lets the user queue guide text.",
- "metadata": {
- "kind": "goal-verifier",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "goal verifier queue 需要稳定 verifier running 窗口;真实 verifier 可能过快完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_GOAL_VERIFY", "Verify whether the active session goal"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 60000,
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-running-guide-goal-verify-delayed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"Delayed verifier should be stopped by cleanup.\\\",\\\"nextAction\\\":\\\"\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":220,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "upstream-running-guide-steer-followup-drain",
- "description": "M06: 基础 provider batch 完成后,guide follow-up 进入同一 active turn 的下一次请求。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "稳定观察 guide 从 steer queue drain 为真实 user row,并保留后续 running 窗口。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_STEER_BASE", "E2E_RUNNING_GUIDE_STEER_FOLLOWUP"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageIncludes": ["E2E_RUNNING_GUIDE_STEER_FOLLOWUP"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 60000,
- "text": {
- "id": "upstream-e2e-running-guide-steer-followup-drain",
- "inputTokens": 150,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-steer-drain",
- "description": "M06d: active goal continuation batch 完成后,guide steer 在目标链路内继续运行。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "稳定观察 active goal guide drain 为真实 user row,同时保持 active target 与 running 链路。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_GOAL_ACTIVE", "E2E_RUNNING_GUIDE_GOAL_STEER"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_RUNNING_GUIDE_GOAL_STEER"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 60000,
- "text": {
- "id": "upstream-e2e-running-guide-goal-steer-drain",
- "inputTokens": 160,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-running-guide-goal-verify-queue-no-standalone-request",
- "description": "H11: guide verifier queued text should not create a standalone normal provider request in this observed window.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "goal verifier 不是普通 active turn;guide 文本应作为 future queue 保留,不应走 immediate provider request。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_RUNNING_GUIDE_GOAL_VERIFY_QUEUE"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-running-guide-goal-verify-queue-should-not-send",
- "text": "upstream-e2e-ok"
- }
- }
- }
- ]
- }
|