n8n-nodes-github-copilot 3.31.18 → 3.31.20
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.
|
@@ -126,7 +126,7 @@ class GitHubCopilotOpenAI {
|
|
|
126
126
|
index: choice.index,
|
|
127
127
|
message: {
|
|
128
128
|
role: choice.message.role,
|
|
129
|
-
content: choice.message.content,
|
|
129
|
+
...(choice.message.content !== null && choice.message.content !== undefined && { content: choice.message.content }),
|
|
130
130
|
...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
|
|
131
131
|
},
|
|
132
132
|
finish_reason: choice.finish_reason,
|
|
@@ -148,12 +148,36 @@ class GitHubCopilotOpenAI {
|
|
|
148
148
|
}
|
|
149
149
|
catch (error) {
|
|
150
150
|
if (this.continueOnFail()) {
|
|
151
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
152
|
+
let errorType = "invalid_request_error";
|
|
153
|
+
let errorCode = null;
|
|
154
|
+
if (errorMessage.includes("403") || errorMessage.includes("Forbidden")) {
|
|
155
|
+
errorType = "invalid_request_error";
|
|
156
|
+
errorCode = "insufficient_quota";
|
|
157
|
+
}
|
|
158
|
+
else if (errorMessage.includes("401") || errorMessage.includes("Unauthorized")) {
|
|
159
|
+
errorType = "invalid_request_error";
|
|
160
|
+
errorCode = "invalid_api_key";
|
|
161
|
+
}
|
|
162
|
+
else if (errorMessage.includes("400") || errorMessage.includes("Bad Request")) {
|
|
163
|
+
errorType = "invalid_request_error";
|
|
164
|
+
errorCode = "invalid_request";
|
|
165
|
+
}
|
|
166
|
+
else if (errorMessage.includes("429") || errorMessage.includes("rate limit")) {
|
|
167
|
+
errorType = "rate_limit_error";
|
|
168
|
+
errorCode = "rate_limit_exceeded";
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
errorType = "api_error";
|
|
172
|
+
errorCode = "internal_error";
|
|
173
|
+
}
|
|
151
174
|
returnData.push({
|
|
152
175
|
json: {
|
|
153
176
|
error: {
|
|
154
|
-
message:
|
|
155
|
-
type:
|
|
156
|
-
|
|
177
|
+
message: errorMessage,
|
|
178
|
+
type: errorType,
|
|
179
|
+
param: null,
|
|
180
|
+
code: errorCode,
|
|
157
181
|
},
|
|
158
182
|
},
|
|
159
183
|
pairedItem: { item: i },
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.20",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|
|
@@ -42,7 +42,6 @@ async function makeGitHubCopilotRequest(context, endpoint, body, hasMedia = fals
|
|
|
42
42
|
const headers = {
|
|
43
43
|
...GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.HEADERS.WITH_AUTH(token),
|
|
44
44
|
"User-Agent": "GitHub-Copilot/1.0 (n8n-node)",
|
|
45
|
-
"X-GitHub-Api-Version": "2022-11-28",
|
|
46
45
|
"Editor-Version": "vscode/1.95.0",
|
|
47
46
|
"Editor-Plugin-Version": "copilot/1.0.0",
|
|
48
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.20",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|