Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/lib/actions/uninstall/run-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ function executePlan(plan: UninstallPlan, paths: UninstallPaths, options: Uninst
if (options.keepOpenShell) runtime.log("Keeping OpenShell binaries as requested.");
else for (const target of paths.openshellInstallPaths) removeFileWithOptionalSudo(target, runtime);
removePath(paths.nemoclawStateDir, runtime);
removePath(paths.gatewayLocalStateDir, runtime);
removePath(paths.openshellConfigDir, runtime);
removePath(paths.nemoclawConfigDir, runtime);
}
Expand Down
10 changes: 10 additions & 0 deletions src/lib/domain/uninstall/paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,18 @@ describe("uninstall paths", () => {
const paths = defaultUninstallPaths({ home: "/home/test" });
expect(uninstallStatePaths(paths)).toEqual([
path.join("/home/test", ".nemoclaw"),
path.join("/home/test", ".local", "state", "nemoclaw"),
path.join("/home/test", ".config", "openshell"),
path.join("/home/test", ".config", "nemoclaw"),
]);
});
it("#3456: exposes the Linux Docker-driver gateway state dir so uninstall can clean it", () => {
// ~/.local/state/nemoclaw/ holds the openshell-gateway PID file, SQLite
// database, audit log, and vm-driver/ state. Documented as
// NEMOCLAW_OPENSHELL_GATEWAY_STATE_DIR in docs/reference/commands.md.
// Before this fix, uninstall left it behind (#3456 hulynn comment).
const paths = defaultUninstallPaths({ home: "/home/test" });
expect(paths.gatewayLocalStateDir).toBe(path.join("/home/test", ".local", "state", "nemoclaw"));
expect(uninstallStatePaths(paths)).toContain(path.join("/home/test", ".local", "state", "nemoclaw"));
});
});
6 changes: 4 additions & 2 deletions src/lib/domain/uninstall/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface UninstallPaths {
nemoclawConfigDir: string;
nemoclawShimPath: string;
nemoclawStateDir: string;
gatewayLocalStateDir: string;
openshellConfigDir: string;
openshellInstallPaths: string[];
repoRoot: string;
Expand All @@ -57,6 +58,7 @@ export function defaultUninstallPaths(options: UninstallPathOptions): UninstallP
nemoclawConfigDir: path.join(options.home, ".config", "nemoclaw"),
nemoclawShimPath: path.join(options.home, ".local", "bin", "nemoclaw"),
nemoclawStateDir: path.join(options.home, ".nemoclaw"),
gatewayLocalStateDir: path.join(options.home, ".local", "state", "nemoclaw"),
openshellConfigDir: path.join(options.home, ".config", "openshell"),
openshellInstallPaths: openshellInstallPathsForBinDirs(["/usr/local/bin", xdgBinHome]),
repoRoot: options.repoRoot || path.resolve(__dirname, "..", "..", "..", ".."),
Expand All @@ -73,6 +75,6 @@ export function defaultUninstallPaths(options: UninstallPathOptions): UninstallP
};
}

export function uninstallStatePaths(paths: Pick<UninstallPaths, "nemoclawConfigDir" | "nemoclawStateDir" | "openshellConfigDir">): string[] {
return [paths.nemoclawStateDir, paths.openshellConfigDir, paths.nemoclawConfigDir];
export function uninstallStatePaths(paths: Pick<UninstallPaths, "nemoclawConfigDir" | "nemoclawStateDir" | "openshellConfigDir" | "gatewayLocalStateDir">): string[] {
return [paths.nemoclawStateDir, paths.gatewayLocalStateDir, paths.openshellConfigDir, paths.nemoclawConfigDir];
}
Loading