JuliusBrussee/caveman · error · Error

caveman: remote session revocation was unavailable; credenti

Error message

caveman: remote session revocation was unavailable; credentials kept — retry `caveman logout`

What it means

Logout's remote session revocation request failed at the transport level (network error). Credentials are intentionally retained and the user is told to retry `caveman logout` rather than being logged out with a live server session.

Source

Thrown at packages/cli/src/index.ts:9472

	  }
	  const headers: Record<string, string> = {
	    authorization: `Bearer ${cfg.token}`,
	    "x-cave-client": "cli",
	  };
	  const request: RequestInit = {
	    method: "POST",
	    headers,
	    signal: AbortSignal.timeout(5000),
	  };
	  if (cfg.refreshToken) {
	    headers["content-type"] = "application/json";
	    request.body = JSON.stringify({ refresh_token: cfg.refreshToken });
	  }
	  let response: Response;
	  try {
	    response = await fetch(`${cfg.baseURL}/api/v1/auth/logout`, request);
	  } catch {
	    throw new Error("caveman: remote session revocation was unavailable; credentials kept — retry `caveman logout`");
	  }
	  if (!response.ok) throw new Error(`caveman: remote session revocation failed (HTTP ${response.status}); credentials kept — retry \`caveman logout\``);
	}
	if (externalToken) {
	  console.error("caveman: remote session revoked; CAVE_TOKEN remains set by the parent environment — unset it before the next command");
	  print({ logged_out: true, remote_session_revoked: true, external_token_cleared: false, external_token_source: "CAVE_TOKEN" });
	  return;
	}
	// Persist remote completion before deleting the only local credential. If
	// Keychain/file cleanup fails, the next logout safely retries cleanup without
	// trying to authenticate with the now-revoked session.
	await saveConfig({ ...cfg, logoutPendingLocalCleanup: true });
  clearToken(cfg.tokenStore);
  await saveConfig({ baseURL: "", token: "" });
  print({ logged_out: true });
}

function sleep(ms: number) {

View on GitHub (pinned to 5184b3d11a)

Solutions

  1. Retry `caveman logout` after restoring connectivity
  2. Verify the configured baseURL is reachable
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cli/src/index.ts:8627 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@5184b3d11a (2026-08-18). Data as JSON: /api/errors/aaa67e1d2030b084. Report an issue: GitHub.