Skip to content

Commit 1438599

Browse files
committed
Merge branch 'master' into release
2 parents 5095754 + 5e42bbb commit 1438599

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

libs/vscode/mcp/src/lib/periodic-ai-check.ts

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@ async function runAiAgentCheck() {
158158
getTelemetry().logUsage('ai.configure-agents-check-start');
159159
await promisify(exec)(constructCommand('--check'), {
160160
cwd: workspacePath,
161-
timeout: 120000,
161+
timeout: 300000,
162162
env: {
163163
...process.env,
164164
NX_CONSOLE: 'true',
165165
// we're already executing from latest, we don't have to fetch latest again
166166
NX_AI_FILES_USE_LOCAL: 'true',
167+
NX_VERBOSE_LOGGING: 'true',
167168
},
168169
});
169170
getTelemetry().logUsage('ai.configure-agents-check-end');
@@ -178,7 +179,6 @@ async function runAiAgentCheck() {
178179
// There are many different reasons this could fail so we want to not spam users
179180
const stringified = JSON.stringify(e);
180181
if (!stringified.includes('The following AI agents are out of date')) {
181-
getTelemetry().logUsage('ai.configure-agents-check-error');
182182
// throw this error so that it can be tracked in rollbar - workaround while we track what's going wrong
183183
const nodeVersion = (
184184
await promisify(exec)('node --version')
@@ -197,7 +197,7 @@ async function runAiAgentCheck() {
197197
},
198198
);
199199

200-
const stderr = ((e as any).stderr || '').slice(-500);
200+
const stderr = preserveModulePath((e as any).stderr || '').slice(-500);
201201

202202
const stdout = preserveModulePath(
203203
((e as any).stdout || '').slice(-500),
@@ -227,19 +227,44 @@ async function runAiAgentCheck() {
227227
`MESSAGE:${originalMessage}`,
228228
].join('|');
229229

230+
const reasons = [
231+
'E401',
232+
'E403',
233+
'E404',
234+
'ENOTFOUND',
235+
'ECONNRESET',
236+
'EIDLETIMEOUT',
237+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
238+
];
230239
// there are certain error messages we can't do anything about
231240
// let's track those separately but not throw
232-
if (
233-
errorMessage.includes('E401') ||
234-
errorMessage.includes('E403') ||
235-
errorMessage.includes('E404') ||
236-
errorMessage.includes('ENOTFOUND') ||
237-
errorMessage.includes('ECONNRESET')
238-
) {
239-
getTelemetry().logUsage('ai.configure-agents-check-expected-error');
241+
if (reasons.some((reason) => errorMessage.includes(reason))) {
242+
getTelemetry().logUsage('ai.configure-agents-check-expected-error', {
243+
cause: 'network-or-auth',
244+
});
240245
return;
241246
}
242247

248+
let engineStrict = false;
249+
try {
250+
const npmSetting = await promisify(exec)(
251+
'npm config get engine-strict',
252+
{
253+
cwd: workspacePath,
254+
},
255+
);
256+
engineStrict = npmSetting.stdout.trim() === 'true';
257+
} catch (e) {
258+
// ignore
259+
}
260+
if (engineStrict && errorMessage.includes('EBADENGINE')) {
261+
getTelemetry().logUsage('ai.configure-agents-check-expected-error', {
262+
cause: 'engine-strict',
263+
});
264+
return;
265+
}
266+
getTelemetry().logUsage('ai.configure-agents-check-error');
267+
243268
throw new Error(errorMessage, {
244269
cause: e as Error,
245270
});
@@ -313,7 +338,7 @@ async function runAiAgentCheck() {
313338
try {
314339
await promisify(exec)(checkAllCommand, {
315340
cwd: workspacePath,
316-
timeout: 120000,
341+
timeout: 300000,
317342
env: {
318343
...process.env,
319344
NX_CONSOLE: 'true',

libs/vscode/telemetry/src/lib/google-analytics-sender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class GoogleAnalyticsSender implements TelemetrySender {
7777
getOutputChannel().appendLine(`Uncaught Exception: ${error}`);
7878

7979
const shouldLogToRollbar = this.production
80-
? Math.floor(Math.random() * 25) === 0
80+
? Math.floor(Math.random() * 10) === 0
8181
: true;
8282
if (shouldLogToRollbar) {
8383
this.rollbar.error(error);

0 commit comments

Comments
 (0)