Add a --purge argument (#17) - #20
Merged
Merged
Conversation
--uninstall now removes only the service (unit, /opt/coding-agent-loop) by default. Deleting the configured workspace/logs/state paths and the dedicated service account's home requires --purge alongside it, since --purge alone is meaningless. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17
What the agent did
Summary
Implemented issue #17:
--uninstallnow removes only the service (unit file,/opt/coding-agent-loop, systemd registration) by default; deleting data requires--uninstall --purge.Files changed:
cmd/agent.go— added thepurgeflag,validateFlags(rejects--purgewithout--uninstall), updated usage text, and threadedPurgeintoinstall.UninstallOptions.internal/install/install.go— addedUninstallOptions.Purge; replacedremoveConfiguredStatePathswithresolvedStatePaths(pure resolution) +applyStatePaths(deletes when purging, logs retained paths otherwise); gated the dedicated-useruserdel -ronPurge(kept account+home together when not purging, per the plan's reasoning about orphaned uids).internal/install/install_test.go— addedTestApplyStatePathsRemovesWhenPurging,TestApplyStatePathsKeepsDataWhenNotPurging,TestApplyStatePathsHonoursConfiguredPaths.Makefile— addedpurgetarget/.PHONYentry, rewordeduninstall's help line.README.md— updated the flags table and the "remove everything" section to describe unconditional vs. purge-only steps.Verification:
go build ./...,go vet ./..., andgo test ./internal/install/...all pass (note: this sandbox's ARM64 kernel doesn't support-race's VMA range, and two pre-existinginternal/gittests fail on commit-identity assertions unrelated to this change — both are environment issues, not regressions from this work). Manually verified--purgealone exits 1 with the pairing error and--helpshows the new flag/usage text.Reviewer should double check the dedicated-user judgment call (keep account+home together unless purging) and that plain
--uninstallstill removes/opt/coding-agent-loop/config.json— both match the approved plan's stated decisions.Verification
Tests failed (
make test). This PR is a draft — the failure is reported rather than hidden, so you can judge whether the change is salvageable.Test output (tail)
Changes
Opened automatically by coding-agent-loop (run
2f5f1598-467b-4d0f-a207-27131c31f3e2, attempt 2, modelclaude-sonnet-5, cost $0.8433, session9e41a316-f3d3-4cfb-b07f-c54396f496ab). Nothing here has been reviewed by a human yet.