Skip to content

fix(local-agent): scope install/uninstall to the triggering tool only#176

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
m0Nst3r873:worktree-fix-scope-install-to-tool
Jul 9, 2026
Merged

fix(local-agent): scope install/uninstall to the triggering tool only#176
jeff-r2026 merged 2 commits into
Tencent:mainfrom
m0Nst3r873:worktree-fix-scope-install-to-tool

Conversation

@m0Nst3r873

@m0Nst3r873 m0Nst3r873 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Narrow toolPaths in installDownloadedResource and uninstallResource to only the current context.tool
  • Prevents a sync command targeting one tool (e.g. codebuddy) from installing/uninstalling resources in all other tool directories (workbuddy, claude, etc.)

Root Cause

SkillsHandler.pullItem() and RulesHandler.pullAllRules() iterate over all entries in teamConfig.toolPaths and install to every tool directory that exists on disk. When installDownloadedResource passed the full teamConfig, a skill/rule distributed to codebuddy would also land in .workbuddy/skills/, .claude/skills/, etc.

Fix

Construct a scoped teamConfig with only the triggering tool's path before passing it to the resource handlers. The tool parameter is threaded from executeCommand's context.tool (which comes from the --tool CLI flag on the hook).

Test plan

  • Distribute a skill to codebuddy via ClawPro → verify it only appears in .codebuddy/skills/, not .workbuddy/skills/
  • Uninstall a skill from codebuddy → verify it's only removed from .codebuddy/skills/
  • Distribute a rule to workbuddy → verify it only appears in .workbuddy/rules/
  • npx tsc --noEmit passes
  • npm run build succeeds

🤖 Generated with Claude Code

jaelgeng and others added 2 commits July 9, 2026 17:18
installDownloadedResource and uninstallResource previously passed the
full teamConfig (all toolPaths) to SkillsHandler/RulesHandler, causing
a resource distributed to one tool (e.g. codebuddy) to be installed
into every other tool directory that exists on disk (workbuddy, claude).

Narrow toolPaths to only the current context.tool so resources land
exclusively in the tool that received the sync command.

--story=1032029153857553

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When tool is not in toolPaths, explicitly throw so the error is
surfaced via ack(failed) rather than silently writing manifest entries
with no corresponding files on disk.

--story=1032029153857553

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeff-r2026 jeff-r2026 merged commit 3720bc3 into Tencent:main Jul 9, 2026
7 checks passed
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.

2 participants