conversation-session-subagent-model-boundary.json 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-subagent-model-boundary",
  4. "spec": "./test/e2e/conversation-session/conversation-session-subagent-model-boundary.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "subagent-boundary-parent-agent",
  8. "description": "父会话触发没有显式模型覆盖的 general-purpose child。",
  9. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "固定 Agent tool_use,模型身份由真实运行时请求断言。" },
  10. "maxMatches": 1,
  11. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_MODEL_BOUNDARY_PARENT", "E2E_SUBAGENT_MODEL_BOUNDARY_CHILD"], "bodyExcludes": ["E2E_SUBAGENT_MODEL_BOUNDARY_CHILD_DONE", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  12. "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_subagent_model_boundary", "name": "Agent", "input": { "description": "Run inherited child", "prompt": "E2E_SUBAGENT_MODEL_BOUNDARY_CHILD: reply exactly E2E_SUBAGENT_MODEL_BOUNDARY_CHILD_DONE and no other text.", "subagent_type": "general-purpose" } } }
  13. },
  14. {
  15. "id": "subagent-boundary-child-delayed",
  16. "description": "child 响应延迟,给父会话切换模型的在途窗口。",
  17. "metadata": { "kind": "main", "timingPolicy": "delayed-text", "source": "synthetic", "syntheticReason": "延迟只用于验证 child execution snapshot,不改变业务结果。" },
  18. "maxMatches": 1,
  19. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_MODEL_BOUNDARY_CHILD"], "bodyExcludes": ["E2E_SUBAGENT_MODEL_BOUNDARY_CHILD_DONE", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  20. "response": { "statusCode": 200, "delayMs": 30000, "text": { "id": "subagent-boundary-child", "inputTokens": 40, "outputTokens": 8, "text": "E2E_SUBAGENT_MODEL_BOUNDARY_CHILD_DONE" } }
  21. },
  22. {
  23. "id": "subagent-boundary-parent-final",
  24. "description": "父会话消费 child 结果并完成。",
  25. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "验证父 continuation 仍能完成。" },
  26. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_MODEL_BOUNDARY_PARENT", "E2E_SUBAGENT_MODEL_BOUNDARY_CHILD_DONE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  27. "response": { "statusCode": 200, "text": { "id": "subagent-boundary-parent-final", "inputTokens": 60, "outputTokens": 8, "text": "E2E_SUBAGENT_MODEL_BOUNDARY_PARENT_DONE" } }
  28. },
  29. {
  30. "id": "subagent-nested-parent-agent",
  31. "description": "三层场景的父 Agent tool_use。",
  32. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "固定第一层 child。" },
  33. "maxMatches": 1,
  34. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_NESTED_PARENT", "E2E_SUBAGENT_NESTED_CHILD"], "bodyExcludes": ["E2E_SUBAGENT_NESTED_CHILD_DONE", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  35. "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_subagent_nested_child", "name": "Agent", "input": { "description": "Run nested child", "prompt": "E2E_SUBAGENT_NESTED_CHILD: launch a grandchild Agent for E2E_SUBAGENT_NESTED_GRANDCHILD, then reply exactly E2E_SUBAGENT_NESTED_CHILD_DONE.", "subagent_type": "general-purpose" } } }
  36. },
  37. {
  38. "id": "subagent-nested-child-agent",
  39. "description": "第二层 child 继续触发 grandchild。",
  40. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "固定第二层 Agent tool_use。" },
  41. "maxMatches": 1,
  42. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_NESTED_CHILD", "E2E_SUBAGENT_NESTED_GRANDCHILD"], "bodyExcludes": ["E2E_SUBAGENT_NESTED_GRANDCHILD_DONE", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  43. "response": { "statusCode": 200, "toolUse": { "id": "toolu_e2e_subagent_nested_grandchild", "name": "Agent", "input": { "description": "Run nested grandchild", "prompt": "E2E_SUBAGENT_NESTED_GRANDCHILD: reply exactly E2E_SUBAGENT_NESTED_GRANDCHILD_DONE and no other text.", "subagent_type": "general-purpose" } } }
  44. },
  45. {
  46. "id": "subagent-nested-grandchild-final",
  47. "description": "第三层 grandchild 固定回复。",
  48. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "验证第三层请求实际使用继承身份。" },
  49. "maxMatches": 1,
  50. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_NESTED_GRANDCHILD"], "bodyExcludes": ["E2E_SUBAGENT_NESTED_GRANDCHILD_DONE", "Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  51. "response": { "statusCode": 200, "text": { "id": "subagent-nested-grandchild", "inputTokens": 32, "outputTokens": 8, "text": "E2E_SUBAGENT_NESTED_GRANDCHILD_DONE" } }
  52. },
  53. {
  54. "id": "subagent-nested-child-final",
  55. "description": "第二层 child 消费 grandchild 结果。",
  56. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "验证直接父级收到 grandchild tool_result。" },
  57. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_NESTED_CHILD", "E2E_SUBAGENT_NESTED_GRANDCHILD_DONE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  58. "response": { "statusCode": 200, "text": { "id": "subagent-nested-child-final", "inputTokens": 48, "outputTokens": 8, "text": "E2E_SUBAGENT_NESTED_CHILD_DONE" } }
  59. },
  60. {
  61. "id": "subagent-nested-parent-final",
  62. "description": "父会话消费第二层 child 结果。",
  63. "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "验证三层调用最终收口。" },
  64. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_SUBAGENT_NESTED_PARENT", "E2E_SUBAGENT_NESTED_CHILD_DONE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] },
  65. "response": { "statusCode": 200, "text": { "id": "subagent-nested-parent-final", "inputTokens": 56, "outputTokens": 8, "text": "E2E_SUBAGENT_NESTED_PARENT_DONE" } }
  66. }
  67. ]
  68. }