fix: Keep search result files in the per-user temp dir - #32
Merged
a1594834522-coder merged 1 commit intoSep 14, 2026
Merged
a1594834522-coder merged 1 commit into
a1594834522-coder merged 1 commit into
Conversation
The search action wrote one text file per search under ~/Library/Caches/memorylake-quick-actions and kept them for a day. They now go to the per-user temp dir macOS provides (getconf DARWIN_USER_TEMP_DIR — resolved that way because services run with an empty environment and $TMPDIR is unset there), which the system purges on reboot and after three idle days, and anything older than an hour is removed on the next search. Co-Authored-By: Claude Fable 5.1 <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.
Summary
Follow-up to #31, which opens search results in TextEdit from a text file. That file was written under
~/Library/Caches/memorylake-quick-actionsand kept for a day, leaving a small but real residue on the user's disk. It now goes to the per-user temp dir macOS provides, which the system purges on reboot and after three idle days, and the action deletes anything older than an hour on the next search. The dir is resolved withgetconf DARWIN_USER_TEMP_DIRrather than$TMPDIR, because services run with an empty environment where$TMPDIRis unset and the fallback would have been the shared/tmp.Changes
scripts/quick-actions/search.sh: results file lives in$(getconf DARWIN_USER_TEMP_DIR)memorylake-quick-actions/; cleanup threshold one hour instead of one day.Test plan
env -i HOME PATH __CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34(the service's environment, noTMPDIR) → file lands under/var/folders/…/T/memorylake-quick-actions/, TextEdit opens it with correct Chinesezsh -nclean🤖 Generated with Claude Code