Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
1c380ea3
authored
Jul 02, 2026
by
Finley Ge
Committed by
GitHub
Jul 02, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(plugin): normalize debug channel routes (#7237)
parent
a1bd28d0
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
16 additions
and
16 deletions
+16
-16
document/content/plugin/system-tool-development.en.mdx
+2
-2
document/content/plugin/system-tool-development.mdx
+2
-2
packages/global/openapi/core/plugin/debug/api.ts
+3
-3
packages/global/openapi/core/plugin/debug/index.ts
+2
-2
projects/app/src/pages/api/plugin/debug-channel/connection-key/exchange.ts
+0
-0
projects/app/src/pages/api/plugin/debug-channel/key/refresh.ts
+0
-0
projects/app/src/pages/dashboard/systemTool/index.tsx
+1
-1
projects/app/src/service/core/plugin/debug/connectionUrl.ts
+1
-1
projects/app/src/web/core/plugin/debug/api.ts
+1
-1
projects/app/test/api/core/plugin/debug/connectionKeyExchange.test.ts
+1
-1
projects/app/test/api/core/plugin/debug/keyRefresh.test.ts
+2
-2
projects/app/test/api/core/plugin/debug/session.test.ts
+1
-1
No files found.
document/content/plugin/system-tool-development.en.mdx
View file @
1c380ea3
...
@@ -380,13 +380,13 @@ Scripts and Agents can use non-interactive mode:
...
@@ -380,13 +380,13 @@ Scripts and Agents can use non-interactive mode:
```bash
```bash
fastgpt-plugin dev --no-interactive \
fastgpt-plugin dev --no-interactive \
--connect "https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange?connectionKey=fpg_dbg_..."
--connect "https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange?connectionKey=fpg_dbg_..."
```
```
When passing only a raw connection key, tell the CLI where the exchange endpoint is:
When passing only a raw connection key, tell the CLI where the exchange endpoint is:
```bash
```bash
FASTGPT_PLUGIN_DEBUG_CONNECT_URL=https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange \
FASTGPT_PLUGIN_DEBUG_CONNECT_URL=https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange \
fastgpt-plugin dev --no-interactive --connect "fpg_dbg_..."
fastgpt-plugin dev --no-interactive --connect "fpg_dbg_..."
```
```
...
...
document/content/plugin/system-tool-development.mdx
View file @
1c380ea3
...
@@ -380,13 +380,13 @@ fastgpt-plugin dev
...
@@ -380,13 +380,13 @@ fastgpt-plugin dev
```bash
```bash
fastgpt-plugin dev --no-interactive \
fastgpt-plugin dev --no-interactive \
--connect "https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange?connectionKey=fpg_dbg_..."
--connect "https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange?connectionKey=fpg_dbg_..."
```
```
如果只传入裸 connection key,需要让 CLI 知道 exchange 接口地址:
如果只传入裸 connection key,需要让 CLI 知道 exchange 接口地址:
```bash
```bash
FASTGPT_PLUGIN_DEBUG_CONNECT_URL=https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange \
FASTGPT_PLUGIN_DEBUG_CONNECT_URL=https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange \
fastgpt-plugin dev --no-interactive --connect "fpg_dbg_..."
fastgpt-plugin dev --no-interactive --connect "fpg_dbg_..."
```
```
...
...
packages/global/openapi/core/plugin/debug/api.ts
View file @
1c380ea3
...
@@ -69,7 +69,7 @@ export const EnablePluginDebugChannelResponseSchema = PluginDebugChannelBaseSche
...
@@ -69,7 +69,7 @@ export const EnablePluginDebugChannelResponseSchema = PluginDebugChannelBaseSche
}),
}),
connectionUrl
:
z
.
string
().
url
().
optional
().
meta
({
connectionUrl
:
z
.
string
().
url
().
optional
().
meta
({
example
:
example
:
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange?connectionKey=fgdbg_xxx'
,
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange?connectionKey=fgdbg_xxx'
,
description
:
'本地 CLI 可直接访问的 FastGPT HTTP 调试连接链接'
description
:
'本地 CLI 可直接访问的 FastGPT HTTP 调试连接链接'
})
})
}).
required
({
}).
required
({
...
@@ -82,7 +82,7 @@ export type EnablePluginDebugChannelResponseType = z.infer<
...
@@ -82,7 +82,7 @@ export type EnablePluginDebugChannelResponseType = z.infer<
/* ============================================================================
/* ============================================================================
* API: 刷新插件调试连接密钥
* API: 刷新插件调试连接密钥
* Route: POST /api/plugin/debug-channel/key
:
refresh
* Route: POST /api/plugin/debug-channel/key
/
refresh
* Method: POST
* Method: POST
* Description: 刷新当前登录团队成员的插件调试 connectionKey,旧连接密钥会失效
* Description: 刷新当前登录团队成员的插件调试 connectionKey,旧连接密钥会失效
* Tags: ['插件调试', 'Write']
* Tags: ['插件调试', 'Write']
...
@@ -212,7 +212,7 @@ export type RevokePluginDebugChannelResponseType = z.infer<
...
@@ -212,7 +212,7 @@ export type RevokePluginDebugChannelResponseType = z.infer<
/* ============================================================================
/* ============================================================================
* API: 兑换插件调试连接信息
* API: 兑换插件调试连接信息
* Route: GET/POST /api/plugin/debug-channel/connection-key
:
exchange
* Route: GET/POST /api/plugin/debug-channel/connection-key
/
exchange
* Method: GET/POST
* Method: GET/POST
* Description: CLI 使用 HTTP 连接链接或 connectionKey 兑换短期 WSS connectToken 和 gateway 连接信息
* Description: CLI 使用 HTTP 连接链接或 connectionKey 兑换短期 WSS connectToken 和 gateway 连接信息
* Tags: ['插件调试', 'Public', 'Write']
* Tags: ['插件调试', 'Public', 'Write']
...
...
packages/global/openapi/core/plugin/debug/index.ts
View file @
1c380ea3
...
@@ -39,7 +39,7 @@ export const PluginDebugPath: OpenAPIPath = {
...
@@ -39,7 +39,7 @@ export const PluginDebugPath: OpenAPIPath = {
}
}
}
}
},
},
'/plugin/debug-channel/key
:
refresh'
:
{
'/plugin/debug-channel/key
/
refresh'
:
{
post
:
{
post
:
{
summary
:
'刷新插件调试连接密钥'
,
summary
:
'刷新插件调试连接密钥'
,
description
:
'刷新当前登录团队成员的插件调试 connectionKey,旧连接密钥会失效'
,
description
:
'刷新当前登录团队成员的插件调试 connectionKey,旧连接密钥会失效'
,
...
@@ -104,7 +104,7 @@ export const PluginDebugPath: OpenAPIPath = {
...
@@ -104,7 +104,7 @@ export const PluginDebugPath: OpenAPIPath = {
}
}
}
}
},
},
'/plugin/debug-channel/connection-key
:
exchange'
:
{
'/plugin/debug-channel/connection-key
/
exchange'
:
{
get
:
{
get
:
{
summary
:
'通过连接链接兑换插件调试连接信息'
,
summary
:
'通过连接链接兑换插件调试连接信息'
,
description
:
description
:
...
...
projects/app/src/pages/api/plugin/debug-channel/connection-key
:
exchange.ts
→
projects/app/src/pages/api/plugin/debug-channel/connection-key
/
exchange.ts
View file @
1c380ea3
File moved
projects/app/src/pages/api/plugin/debug-channel/key
:
refresh.ts
→
projects/app/src/pages/api/plugin/debug-channel/key
/
refresh.ts
View file @
1c380ea3
File moved
projects/app/src/pages/dashboard/systemTool/index.tsx
View file @
1c380ea3
...
@@ -415,7 +415,7 @@ function buildPluginDebugConnectionLink(connectionKey?: string) {
...
@@ -415,7 +415,7 @@ function buildPluginDebugConnectionLink(connectionKey?: string) {
if (!connectionKey || typeof window === 'undefined') return '';
if (!connectionKey || typeof window === 'undefined') return '';
const url = new URL(
const url = new URL(
getWebReqUrl('/api/plugin/debug-channel/connection-key
:
exchange'),
getWebReqUrl('/api/plugin/debug-channel/connection-key
/
exchange'),
window.location.origin
window.location.origin
);
);
url.searchParams.set('connectionKey', connectionKey);
url.searchParams.set('connectionKey', connectionKey);
...
...
projects/app/src/service/core/plugin/debug/connectionUrl.ts
View file @
1c380ea3
...
@@ -37,7 +37,7 @@ export const buildPluginDebugConnectionUrl = ({
...
@@ -37,7 +37,7 @@ export const buildPluginDebugConnectionUrl = ({
if
(
!
origin
)
return
;
if
(
!
origin
)
return
;
const
url
=
new
URL
(
const
url
=
new
URL
(
`
${
serviceEnv
.
NEXT_PUBLIC_BASE_URL
||
''
}
/api/plugin/debug-channel/connection-key
:
exchange`
,
`
${
serviceEnv
.
NEXT_PUBLIC_BASE_URL
||
''
}
/api/plugin/debug-channel/connection-key
/
exchange`
,
origin
origin
);
);
url
.
searchParams
.
set
(
'connectionKey'
,
connectionKey
);
url
.
searchParams
.
set
(
'connectionKey'
,
connectionKey
);
...
...
projects/app/src/web/core/plugin/debug/api.ts
View file @
1c380ea3
...
@@ -13,7 +13,7 @@ export const enablePluginDebugChannel = (data: EnablePluginDebugChannelBodyType
...
@@ -13,7 +13,7 @@ export const enablePluginDebugChannel = (data: EnablePluginDebugChannelBodyType
export
const
refreshPluginDebugConnectionKey
=
(
export
const
refreshPluginDebugConnectionKey
=
(
data
:
RefreshPluginDebugConnectionKeyBodyType
=
{}
data
:
RefreshPluginDebugConnectionKeyBodyType
=
{}
)
=>
POST
<
RefreshPluginDebugConnectionKeyResponseType
>
(
'/plugin/debug-channel/key
:
refresh'
,
data
);
)
=>
POST
<
RefreshPluginDebugConnectionKeyResponseType
>
(
'/plugin/debug-channel/key
/
refresh'
,
data
);
export
const
getPluginDebugChannel
=
()
=>
export
const
getPluginDebugChannel
=
()
=>
GET
<
GetPluginDebugChannelResponseType
>
(
'/plugin/debug-channel'
,
{});
GET
<
GetPluginDebugChannelResponseType
>
(
'/plugin/debug-channel'
,
{});
...
...
projects/app/test/api/core/plugin/debug/connectionKeyExchange.test.ts
View file @
1c380ea3
...
@@ -16,7 +16,7 @@ vi.mock('@fastgpt/service/thirdProvider/fastgptPlugin', () => ({
...
@@ -16,7 +16,7 @@ vi.mock('@fastgpt/service/thirdProvider/fastgptPlugin', () => ({
pluginClient
:
mocks
.
pluginClient
pluginClient
:
mocks
.
pluginClient
}));
}));
import
handler
from
'@/pages/api/plugin/debug-channel/connection-key
:
exchange'
;
import
handler
from
'@/pages/api/plugin/debug-channel/connection-key
/
exchange'
;
describe
(
'plugin debug channel connection key exchange handler'
,
()
=>
{
describe
(
'plugin debug channel connection key exchange handler'
,
()
=>
{
let
originalIsPlus
:
unknown
;
let
originalIsPlus
:
unknown
;
...
...
projects/app/test/api/core/plugin/debug/keyRefresh.test.ts
View file @
1c380ea3
...
@@ -16,7 +16,7 @@ vi.mock('@fastgpt/service/thirdProvider/fastgptPlugin', () => ({
...
@@ -16,7 +16,7 @@ vi.mock('@fastgpt/service/thirdProvider/fastgptPlugin', () => ({
pluginClient
:
mocks
.
pluginClient
pluginClient
:
mocks
.
pluginClient
}));
}));
import
handler
from
'@/pages/api/plugin/debug-channel/key
:
refresh'
;
import
handler
from
'@/pages/api/plugin/debug-channel/key
/
refresh'
;
describe
(
'plugin debug channel key refresh handler'
,
()
=>
{
describe
(
'plugin debug channel key refresh handler'
,
()
=>
{
let
originalIsPlus
:
unknown
;
let
originalIsPlus
:
unknown
;
...
@@ -74,7 +74,7 @@ describe('plugin debug channel key refresh handler', () => {
...
@@ -74,7 +74,7 @@ describe('plugin debug channel key refresh handler', () => {
keyId
:
'key_refreshed'
,
keyId
:
'key_refreshed'
,
connectionKey
:
'connection_key_refreshed'
,
connectionKey
:
'connection_key_refreshed'
,
connectionUrl
:
connectionUrl
:
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange?connectionKey=connection_key_refreshed'
,
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange?connectionKey=connection_key_refreshed'
,
createdAt
:
1
_781_500_000_000
,
createdAt
:
1
_781_500_000_000
,
updatedAt
:
1
_781_500_100_000
,
updatedAt
:
1
_781_500_100_000
,
refreshedAt
:
1
_781_500_100_000
refreshedAt
:
1
_781_500_100_000
...
...
projects/app/test/api/core/plugin/debug/session.test.ts
View file @
1c380ea3
...
@@ -80,7 +80,7 @@ describe('plugin debug channel enable handler', () => {
...
@@ -80,7 +80,7 @@ describe('plugin debug channel enable handler', () => {
keyId
:
'key_test'
,
keyId
:
'key_test'
,
connectionKey
:
'connection_key'
,
connectionKey
:
'connection_key'
,
connectionUrl
:
connectionUrl
:
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
:
exchange?connectionKey=connection_key'
,
'https://fastgpt.example.com/api/plugin/debug-channel/connection-key
/
exchange?connectionKey=connection_key'
,
createdAt
:
1
_781_500_000_000
,
createdAt
:
1
_781_500_000_000
,
updatedAt
:
1
_781_500_000_000
updatedAt
:
1
_781_500_000_000
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment