@@ -32,7 +32,11 @@ declare const __MCP_VERSION__: string;
32
32
* @param cloudBaseOptions CloudBase 配置选项
33
33
* @returns GitHub Issue 创建链接
34
34
*/
35
- async function generateGitHubIssueLink ( toolName : string , errorMessage : string , args : any , cloudBaseOptions ?: CloudBaseOptions ) : Promise < string > {
35
+ async function generateGitHubIssueLink ( toolName : string , errorMessage : string , args : any , cloudBaseOptions ?: CloudBaseOptions , payload ?: {
36
+ requestId : string ;
37
+ ide : string ;
38
+ } ) : Promise < string > {
39
+ const { requestId, ide } = payload || { } ;
36
40
const baseUrl = 'https://github.com/TencentCloudBase/CloudBase-AI-ToolKit/issues/new' ;
37
41
38
42
// 尝试获取环境ID
@@ -68,6 +72,8 @@ ${envIdSection}
68
72
- MCP 版本:${ process . env . npm_package_version || __MCP_VERSION__ || 'unknown' }
69
73
- 系统架构: ${ os . arch ( ) }
70
74
- 时间: ${ new Date ( ) . toISOString ( ) }
75
+ - 请求ID: ${ requestId }
76
+ - 集成IDE: ${ ide }
71
77
72
78
## 工具参数
73
79
\`\`\`json
@@ -122,9 +128,10 @@ function createWrappedHandler(name: string, handler: any, server: ExtendedMcpSer
122
128
} ) ;
123
129
124
130
// 生成 GitHub Issue 创建链接
125
- const issueLink = await generateGitHubIssueLink ( name , errorMessage , args , server . cloudBaseOptions ) ;
126
-
127
- // 创建增强的错误消息,包含 GitHub Issue 链接
131
+ const issueLink = await generateGitHubIssueLink ( name , errorMessage , args , server . cloudBaseOptions , {
132
+ requestId : ( typeof error === 'object' && error && 'requestId' in error ) ? ( error as any ) . requestId : '' ,
133
+ ide : server . ide || process . env . INTEGRATION_IDE || ''
134
+ } ) ;
128
135
const enhancedErrorMessage = `${ errorMessage } \n\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${ issueLink } ` ;
129
136
130
137
// 创建新的错误对象,保持原有的错误类型但更新消息
0 commit comments