coding-tool-x 3.6.6 → 3.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="/favicon.ico">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>coding-tool-x · AI 编程工作台</title>
8
- <script type="module" crossorigin src="/assets/index-BsdIJwLf.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-fWgvlZQx.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/markdown-BNJfEgCA.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vue-vendor-B5RqjEjQ.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/naive-ui-DM897mIP.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-tool-x",
3
- "version": "3.6.6",
3
+ "version": "3.6.7",
4
4
  "description": "Vibe Coding 增强工作助手 - 智能会话管理、动态渠道切换、全局搜索、实时监控",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -67,10 +67,10 @@ function redirectModel(originalModel, channel, options = {}) {
67
67
  }
68
68
 
69
69
  /**
70
- * 解析代理目标 URL,避免 /v1/v1 重复
70
+ * 解析代理目标 URL,避免 API 版本段重复
71
71
  *
72
- * 当 baseUrl 以 /v1 结尾且请求路径也以 /v1 开头时,
73
- * 去掉 baseUrl 的 /v1 后缀,因为 http-proxy 会自动拼接 req.url。
72
+ * 当 baseUrl 和请求路径都包含同一个 API 版本段时,去掉 baseUrl 的
73
+ * 版本后缀,因为 http-proxy 会自动拼接 req.url。
74
74
  *
75
75
  * @param {string} baseUrl - 渠道配置的 base_url
76
76
  * @param {string} requestPath - 请求路径
@@ -81,6 +81,9 @@ function resolveTargetUrl(baseUrl, requestPath) {
81
81
  if (target.endsWith('/')) {
82
82
  target = target.slice(0, -1);
83
83
  }
84
+ if (target.endsWith('/v1beta') && requestPath.startsWith('/v1beta')) {
85
+ return target.slice(0, -7);
86
+ }
84
87
  if (target.endsWith('/v1') && requestPath.startsWith('/v1')) {
85
88
  target = target.slice(0, -3);
86
89
  }