{ "version": 1, "caseName": "conversation-session-background-file-diff", "spec": "./test/e2e/conversation-session/background/conversation-session-background-file-diff.test.ts", "fixtures": [ { "id": "upstream-background-file-diff-title", "description": "BG41 会话标题 sidecar 固定响应。", "metadata": { "kind": "common", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "标题不参与 model-only 文件 checkpoint 语义,只用 case marker 隔离请求。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["Generate a concise title", "E2E_BACKGROUND_FILE_DIFF"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json; charset=utf-8" }, "body": "{\"id\":\"upstream-background-file-diff-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Background File Diff E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}" } }, { "id": "upstream-background-file-diff-agent-tool", "description": "BG41 父模型启动一个真实 background Agent。", "metadata": { "kind": "main", "timingPolicy": "fast-tool-use", "source": "synthetic", "syntheticReason": "固定 Agent(run_in_background=true),制造父 launch turn 与后续 model-only notification turn。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_BACKGROUND_FILE_DIFF", "background-file-diff-e2e/result.md"], "bodyExcludes": [ "Async agent launched successfully", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal" ], "lastUserMessageExcludes": [""], "lastUserMessageIncludes": ["E2E_BACKGROUND_FILE_DIFF"] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_background_file_diff_agent", "messageId": "msg_e2e_background_file_diff_agent", "name": "Agent", "input": { "description": "BG41 update background diff", "prompt": "E2E_BACKGROUND_FILE_DIFF_CHILD: Return exactly E2E_BACKGROUND_FILE_DIFF_CHILD_DONE.", "run_in_background": true } } } }, { "id": "upstream-background-file-diff-launch-ack", "description": "BG41 父模型在 async launch result 后先结束启动轮。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "让父 turn 在 child 完成前稳定 idle,确保后续走独立 model-only wake。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": [ "E2E_BACKGROUND_FILE_DIFF", "toolu_e2e_background_file_diff_agent", "Async agent launched successfully" ], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal" ], "lastUserMessageExcludes": [""] }, "response": { "statusCode": 200, "text": { "id": "upstream-background-file-diff-launch-ack", "inputTokens": 96, "outputTokens": 8, "text": "background-file-diff-agent-launched-ok" } } }, { "id": "upstream-background-file-diff-child-result", "description": "BG41 child 延迟完成,为父 launch turn idle 留出稳定观察窗口。", "metadata": { "kind": "subagent", "timingPolicy": "delayed-text", "source": "synthetic", "syntheticReason": "六秒延迟确保 UI 先稳定观测 canStop=false,再触发独立 notification wake。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_BACKGROUND_FILE_DIFF_CHILD"], "bodyExcludes": [ "background-file-diff-agent-launched-ok", "Async agent launched successfully", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY" ], "lastUserMessageIncludes": ["E2E_BACKGROUND_FILE_DIFF_CHILD"] }, "response": { "statusCode": 200, "delayMs": 6000, "text": { "id": "upstream-background-file-diff-child-result", "inputTokens": 64, "outputTokens": 8, "text": "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE" } } }, { "id": "upstream-background-file-diff-read", "description": "BG41 独立 model-only notification turn 先读取既有文件。", "metadata": { "kind": "main", "timingPolicy": "fast-tool-use", "source": "synthetic", "syntheticReason": "固定 Read 建立 read-before-edit 前提,并让 checkpoint anchor 来自隐藏 notification messageId。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": [ "E2E_BACKGROUND_FILE_DIFF", "", "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE" ], "bodyExcludes": [ "toolu_e2e_background_file_diff_read", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal" ], "lastUserMessageIncludes": ["", "E2E_BACKGROUND_FILE_DIFF_CHILD_DONE"] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_background_file_diff_read", "messageId": "msg_e2e_background_file_diff_read", "name": "Read", "input": { "file_path": "background-file-diff-e2e/result.md" } } } }, { "id": "upstream-background-file-diff-edit", "description": "BG41 Read result 后在同一 model-only product turn 编辑单文件。", "metadata": { "kind": "main", "timingPolicy": "fast-tool-use", "source": "synthetic", "syntheticReason": "固定单行替换以精确断言摘要 +1/-1 和 Review before/after 内容。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": [ "E2E_BACKGROUND_FILE_DIFF", "", "toolu_e2e_background_file_diff_read", "before-background-diff" ], "bodyExcludes": [ "toolu_e2e_background_file_diff_edit", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal" ] }, "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_background_file_diff_edit", "messageId": "msg_e2e_background_file_diff_edit", "name": "Edit", "input": { "file_path": "background-file-diff-e2e/result.md", "old_string": "before-background-diff", "new_string": "after-background-diff" } } } }, { "id": "upstream-background-file-diff-final", "description": "BG41 Edit 成功后结束独立 notification product turn。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "固定最终 marker,用于确认文件摘要与 background 结果 assistant 归属同一产品轮次。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": [ "E2E_BACKGROUND_FILE_DIFF", "", "toolu_e2e_background_file_diff_edit", "The file background-file-diff-e2e/result.md has been updated successfully" ], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal" ] }, "response": { "statusCode": 200, "text": { "id": "upstream-background-file-diff-final", "inputTokens": 160, "outputTokens": 8, "text": "background-file-diff-ok" } } } ] }