| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- {
- "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": ["<task-notification>"],
- "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": ["<task-notification>"]
- },
- "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",
- "<task-notification>",
- "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": ["<task-notification>", "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",
- "<task-notification>",
- "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",
- "<task-notification>",
- "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"
- }
- }
- }
- ]
- }
|