conversation-session-subagent-provider-registry-cold-start.json 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-subagent-provider-registry-cold-start",
  4. "spec": "./test/e2e/conversation-session/subagents/conversation-session-subagent-provider-registry-cold-start.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "subagent-provider-registry-cold-start-title",
  8. "description": "subagent provider registry 冷启动 case 内的标题生成固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本 case 的产品语义,只需要稳定返回,防止标题请求误命中业务 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-subagent-provider-registry-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Subagent Provider Registry\\\"}\"}],\"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\"}}"
  27. }
  28. },
  29. {
  30. "id": "subagent-provider-registry-cold-start-parent-tool",
  31. "description": "父 agent 首轮请求返回 Agent tool_use,强制进入绑定 alternate provider 的 subagent。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "核心验证点是 child subagent provider registry 是否存在;父请求只需要稳定触发 Agent tool_use。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_PARENT"],
  43. "bodyIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_PARENT", "e2e-provider-registry-reviewer"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "toolUse": {
  49. "id": "toolu_e2e_subagent_provider_registry",
  50. "name": "Agent",
  51. "input": {
  52. "description": "Run the alternate-provider E2E reviewer",
  53. "prompt": "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD: Reply with exactly \"E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK\" and no other text.",
  54. "subagent_type": "e2e-provider-registry-reviewer"
  55. }
  56. }
  57. }
  58. },
  59. {
  60. "id": "subagent-provider-registry-cold-start-child",
  61. "description": "绑定 alternate provider 的 child subagent 固定回复。",
  62. "metadata": {
  63. "kind": "main",
  64. "timingPolicy": "fast-text",
  65. "source": "synthetic",
  66. "syntheticReason": "child 请求本身是本 case 的验证证据;响应只需稳定完成并返回子结果 token。"
  67. },
  68. "maxMatches": 1,
  69. "match": {
  70. "method": "POST",
  71. "pathIncludes": "/messages",
  72. "lastUserMessageIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD"],
  73. "bodyIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD"],
  74. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  75. },
  76. "response": {
  77. "statusCode": 200,
  78. "statusMessage": "OK",
  79. "text": {
  80. "id": "upstream-e2e-subagent-provider-registry-child",
  81. "inputTokens": 128,
  82. "outputTokens": 16,
  83. "text": "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK"
  84. }
  85. }
  86. },
  87. {
  88. "id": "subagent-provider-registry-cold-start-parent-final",
  89. "description": "父 agent 收到 child tool_result 后的固定最终回复。",
  90. "metadata": {
  91. "kind": "main",
  92. "timingPolicy": "fast-text",
  93. "source": "synthetic",
  94. "syntheticReason": "最终回复只用于证明 Agent tool_result 被父会话继续消费并回到 idle。"
  95. },
  96. "maxMatches": 1,
  97. "match": {
  98. "method": "POST",
  99. "pathIncludes": "/messages",
  100. "bodyIncludes": [
  101. "E2E_SUBAGENT_PROVIDER_REGISTRY_PARENT",
  102. "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK"
  103. ],
  104. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "statusMessage": "OK",
  109. "text": {
  110. "id": "upstream-e2e-subagent-provider-registry-parent-final",
  111. "inputTokens": 160,
  112. "outputTokens": 12,
  113. "text": "upstream-e2e-ok"
  114. }
  115. }
  116. }
  117. ]
  118. }