Repository navigation
fix(install): avoid creating profiles when removing Claude shim - #168
Merged
codeyevsky merged 1 commit intoOct 27, 2026
Merged
codeyevsky merged 1 commit into
codeyevsky merged 1 commit into
Conversation
Skip writes when removing a shim from a missing profile, so removal does not create an empty profile or its parent directories. Keep installation behavior unchanged and cover both missing-file cases with regression tests. Signed-off-by: Nelmad <17722412+Nelmad@users.noreply.github.com>
codeyevsky
approved these changes
Oct 27, 2026
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.
On Windows,
RemoveClaudeShimuses the path returned by$PROFILE.CurrentUserAllHostseven when the profile does not exist; non-Windows targets are already filtered byExists. When the profile is missing,writeShimBlockfalls through toMkdirAllandWriteFile, creating an empty profile and any missing parent directories.Return without writing only when
os.ReadFilereports a missing file and the replacement block is empty. Add twot.TempDirregression tests covering an existing parent directory and missing parent directories. Installation still creates missing files/directories, and existing tests cover replacement/idempotence and preserving unrelated content during removal.Fixes #125.
Validation on macOS arm64 with Go 1.26.10:
go test -count=1 -race ./install/andgo vet ./...passed frompackages/core.git diff --checkpassed.config/health; all five also occur on clean baselineb2b4a54632ce8a7aa469305335fb51161f4d2802.scripts/sg-unit-check.shpassed guard, policy and shared, then stopped inpackages/sandboxatTestDarwinPreviewDenyListandTestCanonicalFormsDeduplicateson this macOS host. The latter compares/var/folderswith/private/var/folders. The same failures occur on the clean baseline. Later packages in the script were not reached; core was run directly instead.Checks used temporary HOME directories and explicit Go caches. Manual real-agent check: not performed; validation was limited to isolated tests without installing SolonGate or modifying real agent settings. Windows/PowerShell execution remains unverified. The regression tests exercise the platform-independent helper with temporary files.