conversation-session-r3-remote-hooks.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-remote-hooks",
  4. "spec": "./test/e2e/conversation-session/remote/configuration/conversation-session-r3-remote-hooks.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-hooks-local-title",
  8. "description": "在真实本机回合触发 UserPromptSubmit,验证远端 hook 不会在本机执行,也不会给远端 marker 追加记录。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "在真实本机回合触发 UserPromptSubmit,验证远端 hook 不会在本机执行,也不会给远端 marker 追加记录。"
  14. },
  15. "maxMatches": 2,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "lastUserMessageIncludes": ["E2E_R3_REMOTE_HOOKS_LOCAL_CONTROL"],
  20. "bodyIncludes": ["Generate a concise title"]
  21. },
  22. "response": {
  23. "statusCode": 200,
  24. "headers": {
  25. "content-type": "application/json; charset=utf-8"
  26. },
  27. "body": "{\"id\":\"r3-hooks-local-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"R3 hook local control\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
  28. }
  29. },
  30. {
  31. "id": "r3-hooks-local-reply",
  32. "description": "在真实本机回合触发 UserPromptSubmit,验证远端 hook 不会在本机执行,也不会给远端 marker 追加记录。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "在真实本机回合触发 UserPromptSubmit,验证远端 hook 不会在本机执行,也不会给远端 marker 追加记录。"
  38. },
  39. "maxMatches": 2,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "lastUserMessageIncludes": ["E2E_R3_REMOTE_HOOKS_LOCAL_CONTROL"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": {
  49. "id": "r3-hooks-local-reply",
  50. "inputTokens": 64,
  51. "outputTokens": 8,
  52. "text": "R3_HOOKS_LOCAL_REPLY"
  53. }
  54. }
  55. },
  56. {
  57. "id": "r3-hooks-reconnect-title",
  58. "description": "R3 remote hooks task 标题辅助响应。",
  59. "metadata": {
  60. "kind": "common",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "标题不属于冷恢复断言。"
  64. },
  65. "maxMatches": 4,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/chat/completions",
  69. "bodyIncludes": ["Generate a concise title", "E2E_R3_REMOTE_HOOKS"]
  70. },
  71. "response": {
  72. "statusCode": 200,
  73. "headers": {
  74. "content-type": "application/json; charset=utf-8"
  75. },
  76. "body": "{\"id\":\"r3-hooks-title\",\"object\":\"chat.completion\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"R3 remote hooks\\\"}\"},\"finish_reason\":\"stop\"}]}"
  77. }
  78. },
  79. {
  80. "id": "r3-hooks-reconnect-main",
  81. "description": "R3 remote hooks 首发和续发的通用响应。",
  82. "metadata": {
  83. "kind": "main",
  84. "timingPolicy": "slow-stream",
  85. "source": "synthetic",
  86. "syntheticReason": "首发与冷恢复续发都只需要稳定完成,用 task history 断言路由。"
  87. },
  88. "maxMatches": 10,
  89. "match": {
  90. "method": "POST",
  91. "pathIncludes": "/chat/completions",
  92. "bodyIncludes": ["E2E_R3_REMOTE_HOOKS_"],
  93. "bodyExcludes": ["Generate a concise title"]
  94. },
  95. "response": {
  96. "statusCode": 200,
  97. "delayMs": 1200,
  98. "headers": {
  99. "content-type": "text/event-stream; charset=utf-8"
  100. },
  101. "body": "data: {\"id\":\"r3-hooks-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"R3_REMOTE_HOOKS_REPLY\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"r3-hooks-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
  102. }
  103. }
  104. ]
  105. }