n8n-nodes-github-copilot 3.38.2 → 3.38.4

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.
@@ -139,7 +139,11 @@ class GitHubCopilotOpenAI {
139
139
  throw new Error(`Failed to parse tools JSON: ${error instanceof Error ? error.message : "Unknown error"}`);
140
140
  }
141
141
  }
142
- const max_tokens = this.getNodeParameter("max_tokens", i, 4096);
142
+ let max_tokens = this.getNodeParameter("max_tokens", i, 4096);
143
+ if (!max_tokens || max_tokens <= 0 || isNaN(max_tokens)) {
144
+ max_tokens = 4096;
145
+ console.log('⚠️ Invalid max_tokens value, using default: 4096');
146
+ }
143
147
  const seed = this.getNodeParameter("seed", i, 0);
144
148
  const response_format_ui = this.getNodeParameter("response_format", i, "text");
145
149
  const advancedOptions = this.getNodeParameter("advancedOptions", i, {});
@@ -192,6 +196,13 @@ class GitHubCopilotOpenAI {
192
196
  }
193
197
  if (response_format) {
194
198
  requestBody.response_format = response_format;
199
+ if (response_format.type === 'json_object') {
200
+ const allMessagesText = messages.map(m => m.content).join(' ').toLowerCase();
201
+ if (!allMessagesText.includes('json')) {
202
+ throw new Error('When using response_format "json_object", you must include the word "json" in your messages. ' +
203
+ 'Add instructions like "Respond in JSON format" to your system message or user prompt.');
204
+ }
205
+ }
195
206
  }
196
207
  if (seed > 0) {
197
208
  requestBody.seed = seed;
@@ -282,11 +282,12 @@ exports.nodeProperties = [
282
282
  type: "number",
283
283
  typeOptions: {
284
284
  minValue: 1,
285
- maxValue: 4096,
285
+ maxValue: 16384,
286
286
  },
287
- default: "",
288
- placeholder: "1000",
289
- description: "Maximum number of tokens to generate",
287
+ default: 4096,
288
+ placeholder: "4096",
289
+ description: "Maximum number of tokens to generate in the response",
290
+ hint: "Default: 4096 tokens. Increase for longer responses, decrease for shorter ones.",
290
291
  },
291
292
  {
292
293
  displayName: "Top P",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.38.2",
3
+ "version": "3.38.4",
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.2",
3
+ "version": "3.38.4",
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",