Skip to content

fix: copy sibling plugin files when creating an adapter override - #533

Merged
ankitranjan7 merged 2 commits into
agentrhq:mainfrom
chukka-venugopalam:fix/418-adapter-override-sibling-imports
Sep 25, 2026
Merged

ankitranjan7 merged 2 commits into
agentrhq:mainfrom
chukka-venugopalam:fix/418-adapter-override-sibling-imports

Conversation

@chukka-venugopalam

Copy link
Copy Markdown
Contributor

Description

createAdapterOverride() only copied the named command file into ~/.webcmd/clis/<site>/, so a plugin command that imports a sibling file in the same plugin directory (shared helpers, types, constants) would have that import resolve to nothing once forked.

Fix: copy every other file in the plugin's directory alongside the command file when creating an override, skipping any that already exist in the override directory so a user's own edits to a sibling aren't clobbered.

Related issue: Fixes #418

Type of Change

  • Bug fix
  • New feature
  • New site adapter
  • Documentation
  • Refactor
  • CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful
  • If I edited skill-src/, I ran make build and committed skills/ (N/A)

Adapter Notes

  • Updated generated or lean docs when command discoverability changed (N/A)
  • Used positional args for the command's primary subject unless a named flag is clearly better (N/A)
  • Normalized expected adapter failures to CliError subclasses instead of raw Error (N/A)

Screenshots / Output

node_modules\.bin\tsc --noEmit — clean

node_modules\.bin\vitest run src/adapter-override.test.ts:

 ✓  unit  src/adapter-override.test.ts (7 tests)
   ✓ createAdapterOverride (7)
     ✓ copies the plugin command into clis and records provenance
     ✓ copies sibling files from the plugin directory alongside the command
     ✓ does not overwrite a sibling file the user already has in their override dir
     ✓ refuses a command that comes from no installed plugin
     ✓ refuses when a clis copy already exists
     ✓ records commitHash null when the plugin has no lock entry
     ✓ adapter reset removes the clis copy, the provenance record, and the base copy

 Test Files  1 passed (1)
      Tests  7 passed (7)

2 new tests: sibling files are copied; an existing sibling override isn't overwritten.

createAdapterOverride() only copied the named command file into ~/.webcmd/clis/<site>/, so a plugin command that imports a sibling file in the same plugin directory (shared helpers, types, constants) would have that import resolve to nothing once forked.

Copy every other file in the plugin's directory alongside the command file, skipping any that already exist in the override directory so a user's own edits to a sibling aren't clobbered.

Fixes agentrhq#418
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🟢 No documentation gap found — medium confidence

The automated review found no documentation gap in the supplied changes.

This review is advisory and does not block merging.

@ankitranjan7
ankitranjan7 merged commit 9d8ea44 into agentrhq:main Sep 25, 2026
1 check passed
@ankitranjan7

Copy link
Copy Markdown
Contributor

Thanks for the fix and the regression tests — merged!

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.

[Bug]: adapter override breaks adapters with sibling imports

2 participants