@debugg-ai/debugg-ai-mcp 2.1.0 → 2.1.2

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed — ngrok now dials IPv4 loopback explicitly (fixes ERR_NGROK_8012 on macOS Next.js)
11
+
12
+ - `ngrok.connect({addr})` now passes `127.0.0.1:<port>` instead of the bare port number for plain-http localhost URLs. Bare port / `localhost` could resolve to IPv6 `[::1]` first on modern macOS, but Next.js / Vite / most Node dev servers bind to `127.0.0.1` only. Result was a successful tunnel that dialed `[::1]:<port>` and got `connection refused`, surfacing to users as `ERR_NGROK_8012` inside the browser agent trace. Bead `fhg`. Evidenced by real incident log 2026-04-24T19:37Z.
13
+ - Docker (`DOCKER_CONTAINER=true`) and https-localhost paths unchanged.
14
+
15
+ ### Fixed — concurrent callers joining a pending tunnel revoke their redundant key
16
+
17
+ - When caller B's request for a localhost URL arrives while caller A's tunnel for the same port is still provisioning, B used to silently join A's promise and throw away B's own minted ngrok key (and its `revokeKey` callback) — an orphan-key-on-backend leak. B now revokes its redundant key immediately on join. Bead `7qh` finding 2.
18
+
10
19
  ### Added — tunnel fault-injection + trace harness for diagnosis
11
20
 
12
21
  - New `DEBUGG_TUNNEL_FAULT_MODE` env var (dev/test only — inert when `NODE_ENV=production`) lets developers force specific ngrok-side failures without mocking, to reproduce client-reported transient "Tunnel setup failed" incidents. Modes: `fail-connect-N:<count>`, `empty-url-N:<count>`, `delay-connect:<ms>`, combinable with commas. Bead `42g`.
@@ -213,6 +213,13 @@ class TunnelManager {
213
213
  // 2. Deduplicate concurrent creation requests for the same port
214
214
  const pending = this.pendingTunnels.get(port);
215
215
  if (pending) {
216
+ // Bead 7qh Finding 2: our minted tunnelKey/keyId are now redundant — the
217
+ // in-flight call owns the tunnel for this port. Revoke our key up-front
218
+ // so it doesn't orphan on the backend. Failures are swallowed: we can't
219
+ // let cleanup break the join.
220
+ if (revokeKey) {
221
+ revokeKey().catch((err) => logger.warn(`Failed to revoke redundant key while joining pending tunnel for port ${port}:`, err));
222
+ }
216
223
  const info = await pending;
217
224
  return { url: info.publicUrl, tunnelId: info.tunnelId, isLocalhost: true };
218
225
  }
@@ -266,12 +273,17 @@ class TunnelManager {
266
273
  const isHttpsLocal = originalUrl.startsWith('https:');
267
274
  const inDocker = process.env.DOCKER_CONTAINER === 'true';
268
275
  const dockerHost = 'host.docker.internal';
276
+ // Bead fhg: force IPv4 loopback when running against localhost. ngrok's
277
+ // default resolution of a bare port or "localhost" can pick IPv6 [::1]
278
+ // first on macOS/modern OSes, but most dev servers (Next.js, Vite) bind
279
+ // only to 127.0.0.1 — resulting in ngrok connect:refused + ERR_NGROK_8012
280
+ // on the browser side with no actionable error back to the MCP caller.
269
281
  let localAddr;
270
282
  if (isHttpsLocal) {
271
283
  localAddr = inDocker ? `https://${dockerHost}:${port}` : `https://localhost:${port}`;
272
284
  }
273
285
  else {
274
- localAddr = inDocker ? `${dockerHost}:${port}` : port;
286
+ localAddr = inDocker ? `${dockerHost}:${port}` : `127.0.0.1:${port}`;
275
287
  }
276
288
  // Bead ixh: 3-attempt retry for ngrok.connect transient failures. Previously
277
289
  // only retried ONCE (with agent reset), which is insufficient against real
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugg-ai/debugg-ai-mcp",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
5
5
  "type": "module",
6
6
  "bin": {