{"record":{"id":"fc06c30b60180839","repo":"ruvnet/ruflo","slug":"session-has-exceeded-maximum-ttl-and-cannot-be-ren","errorCode":null,"errorMessage":"Session has exceeded maximum TTL and cannot be renewed","messagePattern":"Session has exceeded maximum TTL and cannot be renewed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugin-agent-federation/src/domain/services/handshake-service.ts","lineNumber":183,"sourceCode":"      sessionId: this.deps.generateSessionId(),\n      localNodeId: this.deps.getLocalNodeId(),\n      remoteNodeId: remoteNode.nodeId,\n      trustLevel: verifiedManifest ? TrustLevel.VERIFIED : TrustLevel.UNTRUSTED,\n      negotiatedCapabilities,\n      createdAt: now,\n      expiresAt: new Date(now.getTime() + this.config.sessionTtlMs),\n      heartbeatInterval: this.config.heartbeatIntervalMs,\n      sessionToken: this.deps.generateSessionToken(),\n      metrics: FederationSession.createMetrics(),\n    });\n  }\n\n  renewSession(session: FederationSession): FederationSession {\n    const remainingTtl = this.config.maxSessionTtlMs - (Date.now() - session.createdAt.getTime());\n    const renewalTtl = Math.min(this.config.sessionTtlMs, remainingTtl);\n\n    if (renewalTtl <= 0) {\n      throw new Error('Session has exceeded maximum TTL and cannot be renewed');\n    }\n\n    session.renew(new Date(Date.now() + renewalTtl));\n    return session;\n  }\n\n  private cleanExpiredChallenges(): void {\n    const now = Date.now();\n    for (const [id, pending] of this.pendingChallenges) {\n      if (now > pending.expiresAt) {\n        this.pendingChallenges.delete(id);\n      }\n    }\n  }\n}\n","sourceCodeStart":165,"sourceCodeEnd":199,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugin-agent-federation/src/domain/services/handshake-service.ts#L165-L199","documentation":"Thrown by HandshakeService.renewSession when a federation session's remaining TTL indicates it has already passed its expiresAt ceiling. Renewal is only permitted for sessions still inside their TTL window; an expired session may be kept alive indefinitely otherwise, so the service refuses and forces the caller to re-handshake and establish a fresh session.","triggerScenarios":"A handshake session renewal is attempted after the session has exceeded its maximum TTL.","commonSituations":"Long-lived sessions repeatedly renewed until they hit the absolute TTL cap.","solutions":["Perform a fresh handshake to establish a new session instead of renewing.","Track the session's maximum TTL client-side and re-handshake proactively before expiry."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}