conversation-session-preinstalled-tools-startup.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-preinstalled-tools-startup",
  4. "spec": "./test/e2e/conversation-session/conversation-session-preinstalled-tools-startup.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "lop-startup-title",
  8. "description": "固定标题",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于环境变量行为,固定返回。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_LOP_STARTUP"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "lop-startup-title",
  24. "text": "{\"title\":\"Preinstalled tools\"}",
  25. "inputTokens": 100,
  26. "outputTokens": 10
  27. }
  28. }
  29. },
  30. {
  31. "id": "lop-startup-continue-call",
  32. "description": "continue 读取环境与记录",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "固定触发真实 Bash 环境读取;不依赖模型选择命令。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "bodyIncludes": ["E2E_LOP_STARTUP_CONTINUE"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "toolUse": {
  49. "id": "toolu_lop_startup_continue",
  50. "name": "Bash",
  51. "input": {
  52. "command": "node -e \"const fs=require('node:fs/promises');const path=require('node:path');const p=path.join(process.env.PATH.split(path.delimiter)[0],'zcode-soffice'+(process.platform==='win32'?'.shim':''));fs.readFile(p,'utf8').then(content=>console.log(JSON.stringify({entryPath:p,available:process.env.ZCODE_PREINSTALLED_TOOLS_AVAILABLE,exists:true,content})),()=>console.log(JSON.stringify({entryPath:p,available:process.env.ZCODE_PREINSTALLED_TOOLS_AVAILABLE,exists:false})))\"",
  53. "description": "Read the fixed preinstalled entry and availability"
  54. }
  55. }
  56. }
  57. },
  58. {
  59. "id": "lop-startup-continue-done",
  60. "description": "continue 返回完成",
  61. "metadata": {
  62. "kind": "main",
  63. "timingPolicy": "fast-text",
  64. "source": "synthetic",
  65. "syntheticReason": "固定触发真实 Bash 环境读取;不依赖模型选择命令。"
  66. },
  67. "maxMatches": 1,
  68. "match": {
  69. "method": "POST",
  70. "pathIncludes": "/messages",
  71. "bodyIncludes": ["E2E_LOP_STARTUP_CONTINUE", "toolu_lop_startup_continue"],
  72. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  73. },
  74. "response": {
  75. "statusCode": 200,
  76. "text": {
  77. "id": "lop-startup-continue-done",
  78. "text": "E2E_LOP_STARTUP_CONTINUE_DONE",
  79. "inputTokens": 100,
  80. "outputTokens": 10
  81. }
  82. }
  83. },
  84. {
  85. "id": "lop-startup-before-call",
  86. "description": "before 读取环境与记录",
  87. "metadata": {
  88. "kind": "main",
  89. "timingPolicy": "fast-text",
  90. "source": "synthetic",
  91. "syntheticReason": "固定触发真实 Bash 环境读取;不依赖模型选择命令。"
  92. },
  93. "maxMatches": 1,
  94. "match": {
  95. "method": "POST",
  96. "pathIncludes": "/messages",
  97. "bodyIncludes": ["E2E_LOP_STARTUP_BEFORE"],
  98. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  99. },
  100. "response": {
  101. "statusCode": 200,
  102. "toolUse": {
  103. "id": "toolu_lop_startup_before",
  104. "name": "Bash",
  105. "input": {
  106. "command": "node -e \"const fs=require('node:fs/promises');const path=require('node:path');const p=path.join(process.env.PATH.split(path.delimiter)[0],'zcode-soffice'+(process.platform==='win32'?'.shim':''));fs.readFile(p,'utf8').then(content=>console.log(JSON.stringify({entryPath:p,available:process.env.ZCODE_PREINSTALLED_TOOLS_AVAILABLE,exists:true,content})),()=>console.log(JSON.stringify({entryPath:p,available:process.env.ZCODE_PREINSTALLED_TOOLS_AVAILABLE,exists:false})))\"",
  107. "description": "Read the fixed preinstalled entry and availability"
  108. }
  109. }
  110. }
  111. },
  112. {
  113. "id": "lop-startup-before-done",
  114. "description": "before 返回完成",
  115. "metadata": {
  116. "kind": "main",
  117. "timingPolicy": "fast-text",
  118. "source": "synthetic",
  119. "syntheticReason": "固定触发真实 Bash 环境读取;不依赖模型选择命令。"
  120. },
  121. "maxMatches": 1,
  122. "match": {
  123. "method": "POST",
  124. "pathIncludes": "/messages",
  125. "bodyIncludes": ["E2E_LOP_STARTUP_BEFORE", "toolu_lop_startup_before"],
  126. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  127. },
  128. "response": {
  129. "statusCode": 200,
  130. "text": {
  131. "id": "lop-startup-before-done",
  132. "text": "E2E_LOP_STARTUP_BEFORE_DONE",
  133. "inputTokens": 100,
  134. "outputTokens": 10
  135. }
  136. }
  137. }
  138. ]
  139. }