@debugg-ai/debugg-ai-mcp 1.0.42 → 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.
|
@@ -197,14 +197,6 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
197
197
|
}
|
|
198
198
|
}, abortController.signal);
|
|
199
199
|
const duration = Date.now() - startTime;
|
|
200
|
-
// If the execution failed because the tunnel URL was unreachable, evict the dead tunnel
|
|
201
|
-
// so the next call re-provisions a fresh one instead of reusing a dead entry.
|
|
202
|
-
const tunnelErrorMsg = finalExecution.errorMessage ?? finalExecution.state?.error ?? '';
|
|
203
|
-
if (ctx.tunnelId && tunnelErrorMsg.includes('unreachable') && tunnelErrorMsg.includes('ngrok')) {
|
|
204
|
-
logger.warn(`Tunnel ${ctx.tunnelId} appears dead (unreachable) — evicting from cache`);
|
|
205
|
-
tunnelManager.stopTunnel(ctx.tunnelId).catch(() => { });
|
|
206
|
-
ctx = { ...ctx, tunnelId: undefined };
|
|
207
|
-
}
|
|
208
200
|
// --- Format result ---
|
|
209
201
|
const outcome = finalExecution.state?.outcome ?? finalExecution.status;
|
|
210
202
|
const nodes = finalExecution.nodeExecutions ?? [];
|
|
@@ -352,12 +344,12 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
352
344
|
}
|
|
353
345
|
finally {
|
|
354
346
|
process.stdin.removeListener('close', onStdinClose);
|
|
355
|
-
//
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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.
|
|
361
353
|
client.revokeNgrokKey(keyId).catch(err => logger.warn(`Failed to revoke unused ngrok key ${keyId}: ${err}`));
|
|
362
354
|
}
|
|
363
355
|
}
|