ruvnet/ruflo · error · Error

Session has exceeded maximum TTL and cannot be renewed

Error message

Session has exceeded maximum TTL and cannot be renewed

What it means

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.

Source

Thrown at v3/@claude-flow/plugin-agent-federation/src/domain/services/handshake-service.ts:183

      sessionId: this.deps.generateSessionId(),
      localNodeId: this.deps.getLocalNodeId(),
      remoteNodeId: remoteNode.nodeId,
      trustLevel: verifiedManifest ? TrustLevel.VERIFIED : TrustLevel.UNTRUSTED,
      negotiatedCapabilities,
      createdAt: now,
      expiresAt: new Date(now.getTime() + this.config.sessionTtlMs),
      heartbeatInterval: this.config.heartbeatIntervalMs,
      sessionToken: this.deps.generateSessionToken(),
      metrics: FederationSession.createMetrics(),
    });
  }

  renewSession(session: FederationSession): FederationSession {
    const remainingTtl = this.config.maxSessionTtlMs - (Date.now() - session.createdAt.getTime());
    const renewalTtl = Math.min(this.config.sessionTtlMs, remainingTtl);

    if (renewalTtl <= 0) {
      throw new Error('Session has exceeded maximum TTL and cannot be renewed');
    }

    session.renew(new Date(Date.now() + renewalTtl));
    return session;
  }

  private cleanExpiredChallenges(): void {
    const now = Date.now();
    for (const [id, pending] of this.pendingChallenges) {
      if (now > pending.expiresAt) {
        this.pendingChallenges.delete(id);
      }
    }
  }
}

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Perform a fresh handshake to establish a new session instead of renewing.
  2. Track the session's maximum TTL client-side and re-handshake proactively before expiry.
Defensive patterns

Strategy: fallback

When it happens

Trigger: A handshake session renewal is attempted after the session has exceeded its maximum TTL.

Common situations: Long-lived sessions repeatedly renewed until they hit the absolute TTL cap.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/fc06c30b60180839. Report an issue: GitHub.