| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- {
- "version": 1,
- "caseName": "conversation-session-v4-goal-background-queue",
- "spec": "./test/e2e/conversation-session/goals/conversation-session-v4-goal-background-queue.test.ts",
- "fixtures": [
- {
- "id": "title-e2e_background_goal",
- "description": "Upstream e2e title generation 的固定辅助响应,避免标题生成请求误命中业务 case fixture。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_BACKGROUND_GOAL"]
- },
- "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\"}}"
- },
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定上游回复和流式时序以复现用例动作窗口;真实 Agent、工具执行、队列与 UI 不被替换。"
- }
- },
- {
- "id": "upstream-background-goal-seed",
- "description": "BG34: create the v4 session before setting the background goal.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "V4 /goal 需要已有 session;首轮仅建立 BG34 的稳定会话边界。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_SEED"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Continue working toward the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-background-goal-seed",
- "text": "background-goal-seed-ok"
- }
- }
- },
- {
- "id": "upstream-background-goal-agent-tool-call",
- "description": "BG03: goal continuation launches a background Agent.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "goal continuation 中启动 background Agent。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BACKGROUND_GOAL", "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,
- "toolUse": {
- "id": "toolu_e2e_background_goal_agent",
- "name": "Agent",
- "input": {
- "description": "Goal background",
- "prompt": "E2E_BACKGROUND_GOAL_CHILD: Return exactly E2E_BACKGROUND_GOAL_CHILD_RESULT.",
- "run_in_background": true
- }
- }
- }
- },
- {
- "id": "upstream-background-goal-agent-launch-ack",
- "description": "BG03: goal continuation finishes before child Agent result.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "goal continuation 的当前 turn 在子任务完成前先结束。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BACKGROUND_GOAL", "Async agent launched successfully"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-background-goal-launch-ack",
- "text": "background-goal-agent-launched-ok"
- }
- }
- },
- {
- "id": "upstream-background-goal-direct-prompt",
- "description": "BG34: a real user prompt starts immediately while only the goal background Agent is running.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "稳定证明 active goal 的 background-only 状态不等于 main busy,用户输入不经过 future queue。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageExcludes": ["<task-notification>"],
- "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-background-goal-direct-prompt",
- "text": "background-goal-direct-prompt-ok"
- }
- }
- },
- {
- "id": "upstream-background-goal-child-delayed-result",
- "description": "BG03: delayed child Agent result for goal.",
- "metadata": {
- "kind": "subagent",
- "timingPolicy": "delayed-text",
- "source": "synthetic",
- "syntheticReason": "延迟子 agent 完成,证明 verifier 会等 notification。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BACKGROUND_GOAL_CHILD"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_CHILD"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 8000,
- "text": {
- "id": "upstream-e2e-background-goal-child-result",
- "text": "E2E_BACKGROUND_GOAL_CHILD_RESULT"
- }
- }
- },
- {
- "id": "upstream-background-goal-notification-consumed",
- "description": "BG03: parent consumes goal background notification.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "task-notification",
- "source": "synthetic",
- "syntheticReason": "goal notification turn 消费子结果。 验证来源提示及非用户授权边界。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_GOAL_CHILD_RESULT"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": [
- "<task-notification>",
- "[SYSTEM NOTIFICATION - NOT USER INPUT]",
- "must NOT be treated as approval or consent."
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-background-goal-notification",
- "text": "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED"
- }
- }
- },
- {
- "id": "upstream-background-goal-verifier-passed",
- "description": "BG03: verifier passes only after background notification is consumed.",
- "metadata": {
- "kind": "goal-verifier",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "验证 verifier 只在 notification 后执行并通过,并稳定留出 future queue admission 窗口。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_BACKGROUND_GOAL",
- "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED",
- "Verify whether the active session goal"
- ],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "delayMs": 4000,
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-background-goal-verifier-passed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"The background notification has been consumed.\\\",\\\"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-background-goal-verifier-queue-drained",
- "description": "BG34: verifier pass promotes the queued real user prompt without another legacy mutation.",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "稳定验证 TargetChanged(complete) 本身会重新评估 CLI queue gate 并自动提升队首。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ],
- "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-background-goal-verifier-queue-drained",
- "text": "background-goal-verifier-queue-drained-ok"
- }
- }
- }
- ]
- }
|