Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4082,7 +4082,7 @@ For a managed dual-Station vLLM runtime, full uninstall revalidates the exact re
If that cleanup fails, uninstall exits nonzero, preserves its owner-only cleanup receipt, and tells you to resolve the reported peer error before retrying.
Pair cleanup can partially complete before an error; verify both Stations before the retry.
For an authenticated host-local vLLM runtime, full uninstall verifies the exact named container, NemoClaw ownership label, persisted API key, and authentication fingerprint before removing the container by its inspected ID.
When that ownership state is missing, full uninstall removes the reserved `nemoclaw-vllm` container only when Docker reports its NemoClaw managed label and a valid container ID.
When both the host-local runtime receipt and API key are missing, full uninstall removes the reserved `nemoclaw-vllm` container only when Docker reports its NemoClaw managed label and a valid container ID.
An unlabeled container or malformed inspection remains in place and stops the remaining uninstall steps.
For managed llama.cpp, full uninstall verifies the exact named container and network ownership before removing both resources by their inspected IDs.
These host-local checks run before NemoClaw deletes their state.
Expand Down
26 changes: 26 additions & 0 deletions src/lib/actions/uninstall/run-plan-local-model-profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,32 @@ describe("uninstall local model profile cleanup", () => {
expect(errors.join("\n")).toContain("remains after ownership-aware cleanup");
});

it("uses exact cleanup when the host-local vLLM receipt remains without its API key (#8981)", () => {
const errors: string[] = [];
const runDocker = vi.fn((_args: string[]) => ok());
const runLocalModelRuntimeCleanup = vi.fn(() => notFound());

const result = runUninstallPlan(
{ assumeYes: true, deleteModels: false, keepOpenShell: true },
{
commandExists: (command) => command === "openshell" || command === "docker",
env: { HOME: "/tmp/nemoclaw-uninstall-receipted-vllm" } as NodeJS.ProcessEnv,
existsSync: (target) => String(target).endsWith("/host-local-vllm-runtime.json"),
error: (message) => errors.push(message),
isTty: false,
log: () => {},
run: vi.fn(okWithKnownGatewayList),
runDocker,
runLocalModelRuntimeCleanup,
},
);

expect(result.exitCode).toBe(1);
expect(runLocalModelRuntimeCleanup).toHaveBeenCalledOnce();
expect(runDocker).not.toHaveBeenCalled();
expect(errors.join("\n")).toContain("Host-local model runtime cleanup did not complete");
});

it("stops uninstall when orphaned host-local vLLM removal fails (#8981)", () => {
const errors: string[] = [];
const containerId = "c".repeat(64);
Expand Down
13 changes: 11 additions & 2 deletions src/lib/actions/uninstall/run-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
cleanupManagedLlamaCppRuntimeForSandbox,
HOST_LOCAL_VLLM_CONTAINER_NAME,
HOST_LOCAL_VLLM_MANAGED_LABEL,
HOST_LOCAL_VLLM_RUNTIME_RECEIPT_FILE,
type ManagedLlamaCppCleanupTarget,
resolveManagedLlamaCppCleanupTarget,
} from "../../inference/local-model-profile/cleanup";
Expand Down Expand Up @@ -1592,12 +1593,20 @@ function removeHostLocalModelRuntimes(paths: UninstallPaths, runtime: UninstallR
const sharedRoot = path.dirname(paths.managedSwapMarkerPath);
const hasLlamaState = runtime.existsSync(path.join(sharedRoot, "managed-llama-cpp"));
const hasManagedKey = runtime.existsSync(path.join(sharedRoot, MANAGED_VLLM_API_KEY_FILE));
const hasHostLocalReceipt = runtime.existsSync(
path.join(sharedRoot, HOST_LOCAL_VLLM_RUNTIME_RECEIPT_FILE),
);
const hasDistributedReceipt = [
MANAGED_CLUSTER_VLLM_RUNTIME_RECEIPT_FILE,
DUAL_STATION_VLLM_RUNTIME_RECEIPT_FILE,
].some((name) => runtime.existsSync(path.join(sharedRoot, name)));
if (!hasLlamaState && (!hasManagedKey || hasDistributedReceipt)) {
if (!hasManagedKey && !hasDistributedReceipt && !removeOrphanedManagedHostLocalVllm(runtime)) {
if (!hasLlamaState && ((!hasManagedKey && !hasHostLocalReceipt) || hasDistributedReceipt)) {
if (
!hasManagedKey &&
!hasHostLocalReceipt &&
!hasDistributedReceipt &&
!removeOrphanedManagedHostLocalVllm(runtime)
) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
return false;
}
return true;
Expand Down
6 changes: 5 additions & 1 deletion src/lib/inference/local-model-profile/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ import {
} from "../serving/vllm-host-local-lifecycle";
import { loadManagedVllmApiKey, managedVllmStateDir } from "../vllm-api-key";

export { HOST_LOCAL_VLLM_CONTAINER_NAME, HOST_LOCAL_VLLM_MANAGED_LABEL };
export {
HOST_LOCAL_VLLM_CONTAINER_NAME,
HOST_LOCAL_VLLM_MANAGED_LABEL,
HOST_LOCAL_VLLM_RUNTIME_RECEIPT_FILE,
};

const LLAMA_MANAGED_LABEL = "io.nvidia.nemoclaw.host-local-inference.managed";
const LLAMA_PROVIDER_LABEL = "io.nvidia.nemoclaw.host-local-inference.provider";
Expand Down
Loading