n8n-nodes-github-copilot 3.31.16 → 3.31.18
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.
|
@@ -124,7 +124,11 @@ class GitHubCopilotOpenAI {
|
|
|
124
124
|
model: model,
|
|
125
125
|
choices: response.choices.map((choice) => ({
|
|
126
126
|
index: choice.index,
|
|
127
|
-
message:
|
|
127
|
+
message: {
|
|
128
|
+
role: choice.message.role,
|
|
129
|
+
content: choice.message.content,
|
|
130
|
+
...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
|
|
131
|
+
},
|
|
128
132
|
finish_reason: choice.finish_reason,
|
|
129
133
|
})),
|
|
130
134
|
usage: response.usage || {
|
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.18",
|
|
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",
|
|
@@ -9,6 +9,15 @@ export interface CopilotResponse {
|
|
|
9
9
|
message: {
|
|
10
10
|
role: string;
|
|
11
11
|
content: string;
|
|
12
|
+
tool_calls?: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
function: {
|
|
16
|
+
name: string;
|
|
17
|
+
arguments: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
[key: string]: unknown;
|
|
12
21
|
};
|
|
13
22
|
finish_reason: string;
|
|
14
23
|
}>;
|
|
@@ -41,6 +41,10 @@ async function makeGitHubCopilotRequest(context, endpoint, body, hasMedia = fals
|
|
|
41
41
|
}
|
|
42
42
|
const headers = {
|
|
43
43
|
...GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.HEADERS.WITH_AUTH(token),
|
|
44
|
+
"User-Agent": "GitHub-Copilot/1.0 (n8n-node)",
|
|
45
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
46
|
+
"Editor-Version": "vscode/1.95.0",
|
|
47
|
+
"Editor-Plugin-Version": "copilot/1.0.0",
|
|
44
48
|
};
|
|
45
49
|
if (hasMedia) {
|
|
46
50
|
headers["Copilot-Vision-Request"] = "true";
|
|
@@ -57,8 +61,11 @@ async function makeGitHubCopilotRequest(context, endpoint, body, hasMedia = fals
|
|
|
57
61
|
try {
|
|
58
62
|
const response = await fetch(fullUrl, options);
|
|
59
63
|
if (response.status === 403 && RETRY_ON_403 && attempt < MAX_RETRIES) {
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
const delayMs = BASE_DELAY * Math.pow(2, attempt - 1);
|
|
65
|
+
const jitter = Math.random() * delayMs * 0.2;
|
|
66
|
+
const totalDelay = Math.floor(delayMs + jitter);
|
|
67
|
+
console.warn(`⚠️ GitHub Copilot API 403 error on attempt ${attempt}/${MAX_RETRIES}. Retrying in ${totalDelay}ms...`);
|
|
68
|
+
await new Promise(resolve => setTimeout(resolve, totalDelay));
|
|
62
69
|
continue;
|
|
63
70
|
}
|
|
64
71
|
if (!response.ok) {
|
|
@@ -82,8 +89,11 @@ async function makeGitHubCopilotRequest(context, endpoint, body, hasMedia = fals
|
|
|
82
89
|
catch (error) {
|
|
83
90
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
84
91
|
if (attempt < MAX_RETRIES) {
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
const delayMs = BASE_DELAY * Math.pow(2, attempt - 1);
|
|
93
|
+
const jitter = Math.random() * delayMs * 0.2;
|
|
94
|
+
const totalDelay = Math.floor(delayMs + jitter);
|
|
95
|
+
console.warn(`⚠️ GitHub Copilot API error on attempt ${attempt}/${MAX_RETRIES}: ${lastError.message}. Retrying in ${totalDelay}ms...`);
|
|
96
|
+
await new Promise(resolve => setTimeout(resolve, totalDelay));
|
|
87
97
|
continue;
|
|
88
98
|
}
|
|
89
99
|
throw lastError;
|
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.18",
|
|
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",
|