conversation-session-plugin-remote-explicit-sync-workspace.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-plugin-remote-explicit-sync-workspace",
  4. "spec": "./test/e2e/conversation-session/plugins/conversation-session-plugin-remote-explicit-sync-workspace.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "wpl-011-title",
  8. "description": "WPL-011 remote pre-sync and post-sync tasks use deterministic titles.",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于 remote Plugin 显式同步合同,只需保持 task row 稳定。"
  14. },
  15. "maxMatches": 2,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/chat/completions",
  19. "bodyIncludes": ["Generate a concise title", "E2E_WPL_011_REMOTE_EXPLICIT_SYNC"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  24. "body": "data: {\"id\":\"chatcmpl-wpl-011-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"{\\\"title\\\":\\\"WPL 011 Remote Plugin Sync\\\"}\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-wpl-011-title\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":32,\"completion_tokens\":8,\"total_tokens\":40}}\n\ndata: [DONE]\n\n"
  25. }
  26. },
  27. {
  28. "id": "wpl-011-before-sync",
  29. "description": "The remote task created before explicit sync has no Plugin MCP and receives plain text.",
  30. "metadata": {
  31. "kind": "main",
  32. "timingPolicy": "fast-text",
  33. "source": "synthetic",
  34. "syntheticReason": "稳定建立 connect 后、显式同步前的 remote Session。"
  35. },
  36. "match": {
  37. "method": "POST",
  38. "pathIncludes": "/chat/completions",
  39. "lastUserMessageIncludes": ["E2E_WPL_011_REMOTE_EXPLICIT_SYNC_A_FIRST_PROMPT"],
  40. "bodyExcludes": ["Generate a concise title"]
  41. },
  42. "response": {
  43. "statusCode": 200,
  44. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  45. "body": "data: {\"id\":\"chatcmpl-wpl-011-before\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"WPL_011_REMOTE_EXPLICIT_SYNC_REPLY\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-wpl-011-before\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":32,\"completion_tokens\":8,\"total_tokens\":40}}\n\ndata: [DONE]\n\n"
  46. }
  47. },
  48. {
  49. "id": "wpl-011-plugin-tool-call",
  50. "description": "The new remote Session after explicit sync calls the lifecycle Plugin MCP.",
  51. "metadata": {
  52. "kind": "main",
  53. "timingPolicy": "tool-use",
  54. "source": "synthetic",
  55. "syntheticReason": "固定工具调用,证明只有显式同步后新 Session 才获得 remote Plugin runtime。"
  56. },
  57. "replay": { "consumeOnce": true },
  58. "match": {
  59. "method": "POST",
  60. "pathIncludes": "/chat/completions",
  61. "lastUserMessageIncludes": ["E2E_WPL_011_REMOTE_EXPLICIT_SYNC_RUNTIME_PROMPT"],
  62. "bodyIncludes": [
  63. "E2E_PLUGIN_LIFECYCLE_RUNTIME_1.0.0",
  64. "mcp__plugin_e2e-plugin-lifecycle_lifecycle__version_marker"
  65. ],
  66. "bodyExcludes": ["Generate a concise title"]
  67. },
  68. "response": {
  69. "statusCode": 200,
  70. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  71. "body": "data: {\"id\":\"chatcmpl-wpl-011-tool\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-wpl-011-tool\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"call_wpl_011_plugin\",\"type\":\"function\",\"function\":{\"name\":\"mcp__plugin_e2e-plugin-lifecycle_lifecycle__version_marker\",\"arguments\":\"{}\"}}]},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-wpl-011-tool\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":64,\"completion_tokens\":8,\"total_tokens\":72}}\n\ndata: [DONE]\n\n"
  72. }
  73. },
  74. {
  75. "id": "wpl-011-plugin-final",
  76. "description": "The lifecycle Plugin MCP result closes the post-sync remote turn.",
  77. "metadata": {
  78. "kind": "main",
  79. "timingPolicy": "fast-text",
  80. "source": "synthetic",
  81. "syntheticReason": "固定最终回复,闭合 remote Plugin MCP 调用。"
  82. },
  83. "match": {
  84. "method": "POST",
  85. "pathIncludes": "/chat/completions",
  86. "bodyIncludes": [
  87. "E2E_WPL_011_REMOTE_EXPLICIT_SYNC_RUNTIME_PROMPT",
  88. "call_wpl_011_plugin",
  89. "E2E_PLUGIN_LIFECYCLE_RUNTIME_1.0.0"
  90. ],
  91. "bodyExcludes": ["Generate a concise title"]
  92. },
  93. "response": {
  94. "statusCode": 200,
  95. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  96. "body": "data: {\"id\":\"chatcmpl-wpl-011-final\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"WPL_011_REMOTE_EXPLICIT_SYNC_REPLY\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-wpl-011-final\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-ssh-remote-lifecycle-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":96,\"completion_tokens\":8,\"total_tokens\":104}}\n\ndata: [DONE]\n\n"
  97. }
  98. }
  99. ]
  100. }