修复 ccweb MCP 启动与重载并重新打包
This commit is contained in:
@@ -1133,24 +1133,29 @@ function handleRequest(message) {
|
||||
}
|
||||
if (method === 'config/mcpServer/reload') {
|
||||
mcpReloadCount += 1;
|
||||
send({
|
||||
method: 'mcpServer/startupStatus/updated',
|
||||
params: {
|
||||
server: 'ccweb',
|
||||
state: 'starting',
|
||||
message: 'ccweb MCP starting',
|
||||
threadId: null,
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'mcpServer/startupStatus/updated',
|
||||
params: {
|
||||
name: 'ccweb',
|
||||
status: 'ready',
|
||||
message: 'ccweb MCP ready CC_WEB_MCP_TOKEN=mock-secret-token',
|
||||
threadId: null,
|
||||
},
|
||||
});
|
||||
const suppressReloadStatus = process.env.MOCK_CODEX_APP_MCP_RELOAD_TIMEOUT_ON_SECOND === '1'
|
||||
&& mcpReloadCount >= 2;
|
||||
if (!suppressReloadStatus) {
|
||||
send({
|
||||
method: 'mcpServer/startupStatus/updated',
|
||||
params: {
|
||||
server: 'ccweb',
|
||||
state: 'starting',
|
||||
message: 'ccweb MCP starting',
|
||||
// 模拟 app-server 的全局 reload 通知可能携带其他线程 ID。
|
||||
threadId: 'mock-reload-unrelated-thread',
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'mcpServer/startupStatus/updated',
|
||||
params: {
|
||||
name: 'ccweb',
|
||||
status: 'ready',
|
||||
message: 'ccweb MCP ready CC_WEB_MCP_TOKEN=mock-secret-token',
|
||||
threadId: 'mock-reload-unrelated-thread',
|
||||
},
|
||||
});
|
||||
}
|
||||
send({ id, result: { reloaded: true, reloadCount: mcpReloadCount } });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user