@debugg-ai/debugg-ai-mcp 1.0.41 → 1.0.42

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;
@@ -196,6 +197,14 @@ export async function testPageChangesHandler(input, context, progressCallback) {
196
197
  }
197
198
  }, abortController.signal);
198
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
+ }
199
208
  // --- Format result ---
200
209
  const outcome = finalExecution.state?.outcome ?? finalExecution.status;
201
210
  const nodes = finalExecution.nodeExecutions ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugg-ai/debugg-ai-mcp",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
5
5
  "type": "module",
6
6
  "bin": {