@debugg-ai/debugg-ai-mcp 1.0.41 → 1.0.43
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.
|
@@ -9,6 +9,7 @@ import { handleExternalServiceError } from '../utils/errors.js';
|
|
|
9
9
|
import { fetchImageAsBase64, imageContentBlock } from '../utils/imageUtils.js';
|
|
10
10
|
import { DebuggAIServerClient } from '../services/index.js';
|
|
11
11
|
import { resolveTargetUrl, buildContext, findExistingTunnel, ensureTunnel, sanitizeResponseUrls, touchTunnelById, } from '../utils/tunnelContext.js';
|
|
12
|
+
import { tunnelManager } from '../services/ngrok/tunnelManager.js';
|
|
12
13
|
const logger = new Logger({ module: 'testPageChangesHandler' });
|
|
13
14
|
// Cache the template UUID and project UUIDs within a server session to avoid re-fetching
|
|
14
15
|
let cachedTemplateUuid = null;
|
|
@@ -343,12 +344,12 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
343
344
|
}
|
|
344
345
|
finally {
|
|
345
346
|
process.stdin.removeListener('close', onStdinClose);
|
|
346
|
-
//
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
347
|
+
// Always tear down the tunnel when the request completes.
|
|
348
|
+
if (ctx.tunnelId) {
|
|
349
|
+
tunnelManager.stopTunnel(ctx.tunnelId).catch(err => logger.warn(`Failed to stop tunnel ${ctx.tunnelId}: ${err}`));
|
|
350
|
+
}
|
|
351
|
+
else if (keyId) {
|
|
352
|
+
// Provisioned a key but tunnel creation failed — revoke the orphaned key.
|
|
352
353
|
client.revokeNgrokKey(keyId).catch(err => logger.warn(`Failed to revoke unused ngrok key ${keyId}: ${err}`));
|
|
353
354
|
}
|
|
354
355
|
}
|