[PR #9321] fix: use parent directory name for index.ts plugins in deduplication #13072

Closed
opened 2026-02-16 18:17:57 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9321

State: closed
Merged: No


Summary

  • Fixes plugin deduplication when multiple plugins use index.ts as their filename
  • When a plugin file is named index.ts or index.js, the parent directory name is used instead for deduplication

Problem

When configuring multiple local plugins with file:// URLs that use the common index.ts naming convention:

{
  "plugin": [
    "file:///path/to/my-plugin/index.ts",
    "file:///path/to/other-plugin/index.ts"
  ]
}

Both plugins resolve to the name index, causing the deduplication logic to keep only the last one.

Solution

The getPluginName function now checks if the filename is index and uses the parent directory name instead:

  • file:///path/to/my-plugin/index.tsmy-plugin
  • file:///path/to/other-plugin/index.tsother-plugin
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9321 **State:** closed **Merged:** No --- ## Summary - Fixes plugin deduplication when multiple plugins use `index.ts` as their filename - When a plugin file is named `index.ts` or `index.js`, the parent directory name is used instead for deduplication ## Problem When configuring multiple local plugins with `file://` URLs that use the common `index.ts` naming convention: ```json { "plugin": [ "file:///path/to/my-plugin/index.ts", "file:///path/to/other-plugin/index.ts" ] } ``` Both plugins resolve to the name `index`, causing the deduplication logic to keep only the last one. ## Solution The `getPluginName` function now checks if the filename is `index` and uses the parent directory name instead: - `file:///path/to/my-plugin/index.ts` → `my-plugin` - `file:///path/to/other-plugin/index.ts` → `other-plugin`
yindo added the pull-request label 2026-02-16 18:17:57 -05:00
yindo closed this issue 2026-02-16 18:17:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13072