Skip to content

Commit acded63

Browse files
committed
Merge branch 'master' into release
2 parents 7f16dae + 6fa3997 commit acded63

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { gte } from '@nx-console/nx-version';
21
import { getPackageManagerCommand } from '@nx-console/shared-npm';
32
import { nxLatestProvenanceCheck } from '@nx-console/shared-utils';
43
import { WorkspaceConfigurationStore } from '@nx-console/vscode-configuration';
5-
import { getNxVersion } from '@nx-console/vscode-nx-workspace';
64
import { vscodeLogger } from '@nx-console/vscode-output-channels';
75
import { getTelemetry } from '@nx-console/vscode-telemetry';
86
import { getWorkspacePath } from '@nx-console/vscode-utils';
@@ -18,15 +16,14 @@ import {
1816
tasks,
1917
window,
2018
} from 'vscode';
19+
import { rmSync } from 'fs';
20+
import { tmpdir } from 'os';
21+
import { join } from 'path';
2122

2223
let checkTimer: NodeJS.Timeout | undefined;
2324
let intervalTimer: NodeJS.Timeout | undefined;
2425

2526
export function setupPeriodicAiCheck(context: ExtensionContext) {
26-
if (WorkspaceConfigurationStore.instance.get('aiCheckDontAskAgain', false)) {
27-
return;
28-
}
29-
3027
// Run first check after 1 minute
3128
checkTimer = setTimeout(() => {
3229
runAiAgentCheck();
@@ -109,10 +106,12 @@ async function runAiAgentCheck() {
109106
return;
110107
}
111108

112-
const checkCommand = `${pkgManagerCommands.dlx} nx@latest configure-ai-agents --check`;
113-
114109
try {
115110
getTelemetry().logUsage('ai.configure-agents-check');
111+
// non a project install, so use NPX and don't pollute npx cache
112+
const tmpDir = join(tmpdir(), 'nx-console-tmp');
113+
rmSync(tmpDir, { recursive: true, force: true });
114+
const checkCommand = `npx --cache=${tmpDir} nx@latest configure-ai-agents --check`;
116115
await promisify(exec)(checkCommand, {
117116
cwd: workspacePath,
118117
env: {

0 commit comments

Comments
 (0)