Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(wrapper): extend rootless UID rule to uninstall and backup

AkitaOnRails0533d31cfc36
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca3a7ee5..7651e9e4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,8 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- `bin/ai-memory` no longer fails `install-mcp`, `install-hooks`,
- `setup-agent`, `install-instructions`, and `install-skills` under
- rootless Docker. Rootless Docker maps container UID 0 back to the real
+ `setup-agent`, `install-instructions`, `install-skills`, `uninstall`,
+ and `backup` under rootless Docker. Rootless Docker maps container UID
+ 0 back to the real
host user but routes any other UID (including the host UID the wrapper
always passed via `-u`) through an unrelated subordinate-UID range, so
every write to a bind-mounted host path (`~/.claude/settings.json`,
diff --git a/bin/ai-memory b/bin/ai-memory
index a39587e5..5ec50a50 100755
--- a/bin/ai-memory
+++ b/bin/ai-memory
@@ -297,7 +297,11 @@ case "${WRAPPER_SUBCOMMAND}" in
RENDERS_HOST_CONFIG=1
WRITES_HOST_FILES=1
;;
- install-instructions | install-skills)
+ # uninstall edits the same host agent-config files the install-*
+ # commands write; backup writes its tarball to a host path. Both go
+ # through the same $HOME/$PWD bind mounts, so they need the same
+ # rootless-Docker UID treatment.
+ install-instructions | install-skills | uninstall | backup)
WRITES_HOST_FILES=1
;;
esac
diff --git a/crates/ai-memory-cli/tests/packaging.rs b/crates/ai-memory-cli/tests/packaging.rs
index c5feb99c..1d994d57 100644
--- a/crates/ai-memory-cli/tests/packaging.rs
+++ b/crates/ai-memory-cli/tests/packaging.rs
@@ -262,6 +262,10 @@ fn rootless_docker_uses_root_uid_only_for_host_config_commands() {
"setup-agent",
"install-instructions",
"install-skills",
+ // uninstall edits the same host agent-config files; backup writes
+ // its tarball to a host path — same bind mounts, same UID rule.
+ "uninstall",
+ "backup",
] {
let args = run_wrapper_with_fake_docker(&[subcommand], rootless_info);
assert!(