Skip to content

fix: keep installed binaries on full reset (#2085) - #2086

Open
Aaronontheweb wants to merge 3 commits into
devfrom
fix/investigate-init-existing
Open

fix: keep installed binaries on full reset (#2085)#2086
Aaronontheweb wants to merge 3 commits into
devfrom
fix/investigate-init-existing

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Full reset in netclaw init deletes the installed binaries, so it bricked the CLI and every later netclaw call failed with "No such file or directory".

Changes

  • InitExistingInstallViewModel.RunResetAsync Full scope now enumerates BasePath and deletes every entry except bin/, plus root-level files (netclaw.db, netclaw.pid, netclaw.lock), instead of deleting the whole base directory.
  • The SetupOnly scope and the daemon-stop-first flow are unchanged.
  • Updated FullReset_AfterBothConfirmations_DeletesEverything to seed a bin/ dir and assert it survives while config and the memory DB are purged. It previously asserted the whole base directory was gone, so the binary wipe was invisible to the suite.

Fixes #2085.

@Aaronontheweb Aaronontheweb added bug Something isn't working tui Terminal UI (Termina) issues labels Aug 28, 2026
File.WriteAllText(_paths.NetclawConfigPath, "{}");
File.WriteAllText(_paths.SqliteDbPath, "db");
// bin/ holds the installed binaries; a full reset must purge data but keep it.
var binaryPath = Path.Combine(_paths.BinDirectory, "netclaw");

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small PR but have some nits

{
File.WriteAllText(_paths.NetclawConfigPath, "{}");
File.WriteAllText(_paths.SqliteDbPath, "db");
// bin/ holds the installed binaries; a full reset must purge data but keep it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

foreach (var entry in Directory.GetDirectories(_paths.BasePath))
{
var name = Path.GetFileName(entry);
if (string.Equals(name, "bin", StringComparison.OrdinalIgnoreCase))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to fix this without using a magic string here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tui Terminal UI (Termina) issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

netclaw init full reset deletes installed binaries, bricking the CLI

1 participant