{"record":{"id":"4b5c92908001388e","repo":"deepseek-ai/deepseek-harness","slug":"label-action-in-delayms-ms-attempt-fai","errorCode":null,"errorMessage":"${label}: ${action} in ${delayMs}ms (attempt ${failedAttempts}/${policy.maxAttempts})","messagePattern":"(.+?): (.+?) in (.+?)ms \\(attempt (.+?)/(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp/mcp-client/src/connection.ts","lineNumber":218,"sourceCode":"    }\n    // A connection that stayed up past the stability window (= maxDelayMs, the\n    // longest backoff spacing) ended the previous outage: start a fresh budget.\n    if (connectedAt !== undefined && Date.now() - connectedAt >= policy.maxDelayMs) failedAttempts = 0\n    connectedAt = undefined\n    failedAttempts += 1\n    if (failedAttempts > policy.maxAttempts) {\n      // Enqueue the give-up disposal so it cannot race an in-flight sync's\n      // phase-2 swap (which checks isCurrent inside the queue).\n      syncChain = syncChain.then(() => {\n        for (const dispose of disposers.values()) dispose()\n        disposers = new Map()\n      })\n      ctx.logger.error(`${label}: giving up after ${policy.maxAttempts} consecutive failed reconnect attempts — tools unregistered; reload the plugin or restart the Host to reconnect`)\n      return\n    }\n    const delayMs = Math.min(policy.maxDelayMs, policy.initialDelayMs * 2 ** (failedAttempts - 1))\n    const action = lostEstablishedConnection ? 'connection lost; reconnecting' : 'connection failed; retrying'\n    ctx.logger.warn(`${label}: ${action} in ${delayMs}ms (attempt ${failedAttempts}/${policy.maxAttempts})`)\n    reconnectTimer = setTimeout(() => {\n      reconnectTimer = undefined\n      settling = connectGeneration(false)\n    }, delayMs)\n    // An armed reconnect timer must never hold the process open on its own.\n    reconnectTimer.unref()\n  }\n\n  /**\n   * One connection attempt: fresh transport + client (the MCP SDK binds a\n   * Protocol to one transport for life), connect, then queue the initial tool\n   * sync. The startup flag belongs to the attempt rather than the shared sync\n   * queue, so an early notification cannot consume strict startup semantics.\n   * Every failure funnels through {@link generationDown}; success arms the\n   * onclose-driven disconnect path. Never rejects.\n   *\n   * @param startup - Whether this is the plugin's activation attempt.\n   */","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/mcp/mcp-client/src/connection.ts#L200-L236","documentation":"Error \"${label}: ${action} in ${delayMs}ms (attempt ${failedAttempts}/${policy.maxAttempts})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/mcp/mcp-client/src/connection.ts:218 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the MCP server process and network; the client retries automatically, so restart the server if retries exhaust."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}