Skip to content

fix: use command rm for internal state cleanup#69

Merged
lacymorrow merged 1 commit into
mainfrom
fix/internal-rm-bypass-alias
May 25, 2026
Merged

fix: use command rm for internal state cleanup#69
lacymorrow merged 1 commit into
mainfrom
fix/internal-rm-bypass-alias

Conversation

@lacymorrow

Copy link
Copy Markdown
Owner

Summary

  • Users who alias rm to trash (common macOS habit) saw noisy "file doesn't exist" errors from the trash CLI when running things like tool set claude, because trash doesn't honor rm -f semantics on missing files.
  • Switches internal state-file cleanup in lib/core/{preheat,context,mcp,commands}.sh to command rm -f so it bypasses user aliases.
  • Install/uninstall paths in bin/lacy are intentionally left alone — trash semantics may be desirable there.

Repro (before)

$ tool set claude
2026-05-25 ... trash[...] # Error attempting to move /Users/lacy/.lacy/.server_session_id_56928 to the trash folder ...
2026-05-25 ... trash[...] # Error attempting to move /Users/lacy/.lacy/.claude_session_id_56928 ...
2026-05-25 ... trash[...] # Error attempting to move /Users/lacy/.lacy/.gemini_session_id_56928 ...
Tool set to: claude

Test plan

  • With alias rm=trash in shell: tool set claude produces no noise
  • tool set auto / tool set lash likewise silent
  • /new session doesn't emit trash errors
  • Without the alias, behavior unchanged (silent cleanup as before)

Users who alias `rm` to `trash` (common macOS safety habit) saw noisy
"file doesn't exist" errors from the trash CLI when lacy cleaned up its
own session/temp files — `trash` doesn't honor `-f` semantics like `rm`.

Switches internal cleanup paths (preheat session files, screen-capture
tempfile, streaming temp file, conversation file) to `command rm -f` so
they bypass user aliases. Install/uninstall paths in `bin/lacy` are left
alone since trash semantics may be desirable there.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several shell scripts to use command rm -f instead of a direct rm -f call. This ensures that the standard system utility is executed directly, bypassing any user-defined aliases or shell functions for rm. There are no review comments to address, and I have no additional feedback to provide.

@lacymorrow lacymorrow merged commit 8499b17 into main May 25, 2026
4 checks passed
@lacymorrow lacymorrow deleted the fix/internal-rm-bypass-alias branch May 25, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant