Skip to content

fix: deduplicate plugins when cwd is the home directory#71

Merged
christso merged 3 commits intomainfrom
fix/duplicate-plugins-home-dir
Feb 4, 2026
Merged

fix: deduplicate plugins when cwd is the home directory#71
christso merged 3 commits intomainfrom
fix/duplicate-plugins-home-dir

Conversation

@christso
Copy link
Copy Markdown
Contributor

@christso christso commented Feb 4, 2026

Summary

  • Add isUserConfigPath() to detect when project and user config resolve to the same file (i.e. cwd is the home directory), skipping project-level loading to avoid duplicates
  • Consolidate duplicated process.env.HOME || process.env.USERPROFILE || '~' into a shared getHomeDir() in constants.ts — also fixes a bug in status.ts where USERPROFILE was missing
  • Fix pre-existing Windows test failures in marketplace-manifest-parser.test.ts (hardcoded Unix paths)

Test plan

  • New test: should not duplicate plugins when workspace is the home directory
  • Existing tests updated to use separate HOME dirs so project/user configs don't overlap
  • Manual verification: bun run src/cli/index.ts workspace status from $HOME shows plugins only under User Plugins
  • All 477 tests pass (471 pass + 4 skip + 2 previously failing now fixed)

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 4, 2026

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2285e2d
Status:⚡️  Build in progress...

View logs

christso and others added 2 commits February 4, 2026 15:22
When running from the home directory, project config and user config
resolve to the same file, causing plugins to appear in both scopes.

Add isUserConfigPath() to detect this overlap and skip project-level
loading. Consolidate duplicated home-dir detection into a shared
getHomeDir() in constants.ts (also fixes status.ts missing USERPROFILE).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@christso christso force-pushed the fix/duplicate-plugins-home-dir branch from fa4d14e to bc84aa4 Compare February 4, 2026 04:41
@christso christso changed the title fix(status): deduplicate plugins when running from home directory fix: deduplicate plugins when cwd is the home directory Feb 4, 2026
When cwd resolves to the user config path (e.g., running from ~),
install now correctly uses user scope instead of project scope, and
uninstall skips the project-scope check to avoid double-removal errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@christso christso merged commit 8db0282 into main Feb 4, 2026
1 check was pending
@christso christso deleted the fix/duplicate-plugins-home-dir branch February 4, 2026 05:30
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