Skip to content

Commit f464114

Browse files
Fixes 'checking for updates' CLI response from causing error with flow
1 parent 94f6cc1 commit f464114

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/env/node/gk/cli/integration.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export interface CliCommandRequest {
3636
export type CliCommandResponse = { stdout?: string; stderr?: string } | void;
3737
export type CliIpcServer = IpcServer<CliCommandRequest, CliCommandResponse>;
3838

39+
const CLIProxyMCPInstallOutputs = {
40+
checkingForUpdates: /checking for updates.../i,
41+
notASupportedClient: /is not a supported MCP client/i,
42+
installedSuccessfully: /GitKraken MCP Server Successfully Installed!/i,
43+
};
44+
3945
export class GkCliIntegrationProvider implements Disposable {
4046
private readonly _disposable: Disposable;
4147
private _runningDisposable: Disposable | undefined;
@@ -236,8 +242,8 @@ export class GkCliIntegrationProvider implements Disposable {
236242
},
237243
);
238244

239-
output = output.trim();
240-
if (output === 'GitKraken MCP Server Successfully Installed!') {
245+
output = output.replace(CLIProxyMCPInstallOutputs.checkingForUpdates, '').trim();
246+
if (CLIProxyMCPInstallOutputs.installedSuccessfully.test(output)) {
241247
if (this.container.telemetry.enabled) {
242248
this.container.telemetry.sendEvent('mcp/setup/completed', {
243249
requiresUserCompletion: false,
@@ -246,7 +252,7 @@ export class GkCliIntegrationProvider implements Disposable {
246252
});
247253
}
248254
return;
249-
} else if (output.includes('not a supported MCP client')) {
255+
} else if (CLIProxyMCPInstallOutputs.notASupportedClient.test(output)) {
250256
if (this.container.telemetry.enabled) {
251257
this.container.telemetry.sendEvent('mcp/setup/failed', {
252258
reason: 'unsupported app',

0 commit comments

Comments
 (0)