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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-subagent-provider-registry-cold-start",
  4. "spec": "./test/e2e/conversation-session/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": [
  44. "E2E_SUBAGENT_PROVIDER_REGISTRY_PARENT",
  45. "e2e-provider-registry-reviewer"
  46. ],
  47. "bodyExcludes": [
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "toolUse": {
  55. "id": "toolu_e2e_subagent_provider_registry",
  56. "name": "Agent",
  57. "input": {
  58. "description": "Run the alternate-provider E2E reviewer",
  59. "prompt": "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD: Reply with exactly \"E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK\" and no other text.",
  60. "subagent_type": "e2e-provider-registry-reviewer"
  61. }
  62. }
  63. }
  64. },
  65. {
  66. "id": "subagent-provider-registry-cold-start-child",
  67. "description": "绑定 alternate provider 的 child subagent 固定回复。",
  68. "metadata": {
  69. "kind": "main",
  70. "timingPolicy": "fast-text",
  71. "source": "synthetic",
  72. "syntheticReason": "child 请求本身是本 case 的验证证据;响应只需稳定完成并返回子结果 token。"
  73. },
  74. "maxMatches": 1,
  75. "match": {
  76. "method": "POST",
  77. "pathIncludes": "/messages",
  78. "lastUserMessageIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD"],
  79. "bodyIncludes": ["E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD"],
  80. "bodyExcludes": [
  81. "Generate a concise title",
  82. "CRITICAL: Respond with TEXT ONLY"
  83. ]
  84. },
  85. "response": {
  86. "statusCode": 200,
  87. "statusMessage": "OK",
  88. "text": {
  89. "id": "upstream-e2e-subagent-provider-registry-child",
  90. "inputTokens": 128,
  91. "outputTokens": 16,
  92. "text": "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK"
  93. }
  94. }
  95. },
  96. {
  97. "id": "subagent-provider-registry-cold-start-parent-final",
  98. "description": "父 agent 收到 child tool_result 后的固定最终回复。",
  99. "metadata": {
  100. "kind": "main",
  101. "timingPolicy": "fast-text",
  102. "source": "synthetic",
  103. "syntheticReason": "最终回复只用于证明 Agent tool_result 被父会话继续消费并回到 idle。"
  104. },
  105. "maxMatches": 1,
  106. "match": {
  107. "method": "POST",
  108. "pathIncludes": "/messages",
  109. "bodyIncludes": [
  110. "E2E_SUBAGENT_PROVIDER_REGISTRY_PARENT",
  111. "E2E_SUBAGENT_PROVIDER_REGISTRY_CHILD_OK"
  112. ],
  113. "bodyExcludes": [
  114. "Generate a concise title",
  115. "CRITICAL: Respond with TEXT ONLY"
  116. ]
  117. },
  118. "response": {
  119. "statusCode": 200,
  120. "statusMessage": "OK",
  121. "text": {
  122. "id": "upstream-e2e-subagent-provider-registry-parent-final",
  123. "inputTokens": 160,
  124. "outputTokens": 12,
  125. "text": "upstream-e2e-ok"
  126. }
  127. }
  128. }
  129. ]
  130. }