| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561 |
- {
- "version": 1,
- "caseName": "conversation-session-background-bash-output",
- "spec": "./test/e2e/conversation-session/background/conversation-session-background-bash-output.test.ts",
- "fixtures": [
- {
- "id": "bgv-title",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_BGV_"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"bgv-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Background output\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":32,\"output_tokens\":8}}"
- }
- },
- {
- "id": "EXPLICIT-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_EXPLICIT"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_EXPLICIT"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_EXPLICIT",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" EXPLICIT",
- "description": "EXPLICIT background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "EXPLICIT-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_EXPLICIT", "E2E_BGV_EXPLICIT"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "EXPLICIT-done",
- "text": "E2E_BGV_EXPLICIT_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "AUTO-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_AUTO"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_AUTO"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_AUTO",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" AUTO",
- "description": "AUTO background output",
- "timeout": 1
- }
- }
- ]
- }
- },
- {
- "id": "AUTO-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_AUTO", "E2E_BGV_AUTO"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "AUTO-done",
- "text": "E2E_BGV_AUTO_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "PAUSE-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_PAUSE"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_PAUSE"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_PAUSE",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" PAUSE",
- "description": "PAUSE background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "PAUSE-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_PAUSE", "E2E_BGV_PAUSE"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "PAUSE-done",
- "text": "E2E_BGV_PAUSE_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "SCOPE_A-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_SCOPE_A"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_SCOPE_A"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_SCOPE_A",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" SCOPE_A",
- "description": "SCOPE_A background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "SCOPE_A-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_SCOPE_A", "E2E_BGV_SCOPE_A"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "SCOPE_A-done",
- "text": "E2E_BGV_SCOPE_A_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "SCOPE_B-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_SCOPE_B"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_SCOPE_B"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_SCOPE_B",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" SCOPE_B",
- "description": "SCOPE_B background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "SCOPE_B-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_SCOPE_B", "E2E_BGV_SCOPE_B"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "SCOPE_B-done",
- "text": "E2E_BGV_SCOPE_B_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "ERROR-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_ERROR"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_ERROR"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_ERROR",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" ERROR",
- "description": "ERROR background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "ERROR-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_ERROR", "E2E_BGV_ERROR"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "ERROR-done",
- "text": "E2E_BGV_ERROR_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "STOP-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_STOP"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_STOP"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_STOP",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" STOP",
- "description": "STOP background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "STOP-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["toolu_bgv_STOP", "E2E_BGV_STOP"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "STOP-done",
- "text": "E2E_BGV_STOP_DONE",
- "inputTokens": 96,
- "outputTokens": 16
- }
- }
- },
- {
- "id": "PARENT-call",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_PARENT:"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_parent"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_parent",
- "name": "Agent",
- "input": {
- "description": "background child output",
- "prompt": "E2E_BGV_CHILD_WORK: Start the exact background Bash writer fixture and return.",
- "subagent_type": "general-purpose",
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "PARENT-done",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BGV_PARENT:", "toolu_bgv_parent"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "parent-done",
- "text": "E2E_BGV_PARENT_DONE"
- }
- }
- },
- {
- "id": "CHILD-call",
- "metadata": {
- "kind": "subagent",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BGV_CHILD_WORK:"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_CHILD",
- "toolu_bgv_parent"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_bgv_CHILD",
- "name": "Bash",
- "input": {
- "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" CHILD",
- "description": "child background output",
- "timeout": 120000,
- "run_in_background": true
- }
- }
- ]
- }
- },
- {
- "id": "CHILD-done",
- "metadata": {
- "kind": "subagent",
- "source": "synthetic",
- "timingPolicy": "delayed-text",
- "syntheticReason": "child Bash 在真实后台运行时保持 child 模型请求在途,以验证现有子会话条目及 Stop。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BGV_CHILD_WORK:", "toolu_bgv_CHILD"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_bgv_parent"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "child-done",
- "text": "CHILD_READY"
- },
- "delayMs": 60000
- }
- }
- ]
- }
|