{ "version": 1, "caseName": "conversation-session-fork", "spec": "./test/e2e/conversation-session/branching/conversation-session-fork.test.ts", "fixtures": [ { "id": "conversation-session-fork-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-conversation-fork-basic-source-final", "description": "E01 基础 completed assistant fork 的 source turn 固定回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "基础 fork case 只需要稳定形成 completed assistant 消息;真实 provider 文案不影响 fork 边界语义。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_SOURCE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_SOURCE"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-basic-source-final", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-goal-seed-final", "description": "E07 goal target 注入前 seed turn 固定回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "seed turn 只用于形成可 fork 的稳定 assistant 历史,后续 goal target 通过 sqlite 注入。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_GOAL_SEED"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_GOAL_SEED"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-goal-seed-final", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-goal-source-final", "description": "E07 父 session 有 goal target 时的 source turn,用于让 renderer 同步已注入的 target。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "该 case 的核心语义是 fork child 继承父 target 且不复制父 queue;source turn 只负责完成一次 snapshot 同步,真实 provider 文案不影响断言。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_GOAL_SOURCE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_GOAL_SOURCE"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-goal-source-final", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-goal-held-queue-contract", "description": "E07 held queue marker 合同占位;fork 前父 session queue 不应立即发 provider。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "该 queued prompt 的产品语义是停留在父 session held queue,fork child 不复制它;运行时若命中该 fixture 反而说明 queue guard 失效。" }, "maxMatches": 0, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_GOAL_HELD_QUEUE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_GOAL_HELD_QUEUE"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-goal-held-queue-should-not-send", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-edit-old-final", "description": "E09 edit fork 原始分支 source turn 固定回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "原始分支只用于随后 edit/rewind;真实 provider 文案不影响 active branch fork 断言。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_EDIT_OLD"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_EDIT_OLD"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-edit-old-final", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-edit-active-final", "description": "E09 edit rerun 后 active branch 固定回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "该响应只需要稳定形成编辑后的 active assistant turn,用于证明 fork child 不复制旧分支。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_FORK_EDIT_ACTIVE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageIncludes": ["E2E_FORK_EDIT_ACTIVE"] }, "response": { "statusCode": 200, "text": { "id": "upstream-e2e-conversation-fork-edit-active-final", "inputTokens": 128, "outputTokens": 12, "text": "upstream-e2e-ok" } } }, { "id": "upstream-conversation-fork-goal-running", "description": "E07 真实运行中发送队列,停止后保留父 held queue。", "metadata": { "kind": "main", "timingPolicy": "controlled-stream", "source": "synthetic", "syntheticReason": "固定运行窗口供用户入队和停止,不能用 renderer 伪队列替代 CLI 队列。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_FORK_GOAL_RUNNING"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 200, "statusMessage": "OK", "headers": { "cache-control": "no-cache", "content-type": "text/event-stream; charset=utf-8" }, "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-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\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: 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\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "events": [ { "sequence": 0, "offsetMs": 0, "byteLength": 333, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-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, "byteLength": 120, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" }, { "sequence": 2, "offsetMs": 8000, "byteLength": 118, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n" }, { "sequence": 3, "offsetMs": 16000, "byteLength": 118, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n" }, { "sequence": 4, "offsetMs": 24000, "byteLength": 122, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n" }, { "sequence": 5, "offsetMs": 90000, "byteLength": 49, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" }, { "sequence": 6, "offsetMs": 90100, "byteLength": 179, "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": 7, "offsetMs": 90200, "byteLength": 42, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } ] } } ] }