n8n-nodes-github-copilot 3.38.14 → 3.38.16
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.
|
@@ -91,48 +91,46 @@ class GitHubCopilotChatAPI {
|
|
|
91
91
|
content: systemMessage,
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
let userContent = userMessage;
|
|
95
94
|
if (includeMedia) {
|
|
96
95
|
const mediaSource = this.getNodeParameter("mediaSource", i);
|
|
97
96
|
const mediaFile = this.getNodeParameter("mediaFile", i, "");
|
|
98
97
|
const mediaUrl = this.getNodeParameter("mediaUrl", i, "");
|
|
99
98
|
const mediaBinaryProperty = this.getNodeParameter("mediaBinaryProperty", i, "");
|
|
100
|
-
const contentArray = [];
|
|
101
99
|
if (userMessage.trim()) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
messages.push({
|
|
101
|
+
role: "user",
|
|
102
|
+
content: userMessage,
|
|
105
103
|
});
|
|
106
104
|
}
|
|
107
105
|
try {
|
|
108
106
|
const mediaResult = await (0, mediaDetection_1.processMediaFile)(this, i, mediaSource, mediaFile, mediaUrl, mediaBinaryProperty);
|
|
109
107
|
if (mediaResult.type === "image" && mediaResult.dataUrl) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
108
|
+
messages.push({
|
|
109
|
+
role: "user",
|
|
110
|
+
content: mediaResult.dataUrl,
|
|
111
|
+
type: "file",
|
|
115
112
|
});
|
|
116
113
|
}
|
|
117
114
|
else {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
messages.push({
|
|
116
|
+
role: "user",
|
|
117
|
+
content: `[Image processing failed: ${mediaResult.description}]`,
|
|
121
118
|
});
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
121
|
catch (error) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
messages.push({
|
|
123
|
+
role: "user",
|
|
124
|
+
content: `[Media processing error: ${error instanceof Error ? error.message : "Unknown error"}]`,
|
|
128
125
|
});
|
|
129
126
|
}
|
|
130
|
-
userContent = contentArray;
|
|
131
127
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
else {
|
|
129
|
+
messages.push({
|
|
130
|
+
role: "user",
|
|
131
|
+
content: userMessage,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
136
134
|
const requestBody = {
|
|
137
135
|
model,
|
|
138
136
|
messages,
|
|
@@ -360,6 +360,16 @@ class GitHubCopilotOpenAI {
|
|
|
360
360
|
catch (parseError) {
|
|
361
361
|
console.error('Failed to parse API error:', parseError);
|
|
362
362
|
}
|
|
363
|
+
const lowerMessage = cleanMessage.toLowerCase();
|
|
364
|
+
const is400Error = lowerMessage.includes("400") || lowerMessage.includes("bad request") ||
|
|
365
|
+
(apiError && apiError.error && apiError.error.code === "invalid_request_body");
|
|
366
|
+
if (is400Error) {
|
|
367
|
+
console.log('🚫 400 Bad Request detected - throwing non-retryable error');
|
|
368
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Bad Request (400): ${cleanMessage}`, {
|
|
369
|
+
itemIndex: i,
|
|
370
|
+
description: 'The request was malformed or contains invalid parameters. Retrying will not help.',
|
|
371
|
+
});
|
|
372
|
+
}
|
|
363
373
|
let errorType = "invalid_request_error";
|
|
364
374
|
let errorCode = null;
|
|
365
375
|
let errorParam = null;
|
|
@@ -372,19 +382,7 @@ class GitHubCopilotOpenAI {
|
|
|
372
382
|
console.log('✅ Using GitHub Copilot API error details');
|
|
373
383
|
}
|
|
374
384
|
else {
|
|
375
|
-
|
|
376
|
-
const is400Error = lowerMessage.includes("400") || lowerMessage.includes("bad request");
|
|
377
|
-
if (is400Error) {
|
|
378
|
-
errorType = "invalid_request_error";
|
|
379
|
-
errorCode = "invalid_request";
|
|
380
|
-
finalMessage = cleanMessage;
|
|
381
|
-
console.log('🚫 400 Bad Request detected - throwing non-retryable error');
|
|
382
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Bad Request (400): ${finalMessage}`, {
|
|
383
|
-
itemIndex: i,
|
|
384
|
-
description: 'The request was malformed or contains invalid parameters. Retrying will not help.',
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
else if (lowerMessage.includes("403") || lowerMessage.includes("forbidden")) {
|
|
385
|
+
if (lowerMessage.includes("403") || lowerMessage.includes("forbidden")) {
|
|
388
386
|
errorType = "invalid_request_error";
|
|
389
387
|
errorCode = "insufficient_quota";
|
|
390
388
|
if (lowerMessage.includes("access") && lowerMessage.includes("forbidden")) {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.16",
|
|
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.16",
|
|
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",
|