Skip to content

Workbench plugin install ignores --plugin-dir — the override reaches the loader and nothing else #549

Closed

Description

@thomas-stegemann

Problem

Start the workbench with --plugin-dir X, install a plugin from Settings → Plugins, and it lands in the default directory instead. The list you are looking at reads the default too, so the plugin you just installed does appear — in the directory the host is not loading from.

What changed since this was filed

The original report named four call sites in Core that each rebuilt ~/.bowire/plugins from Environment.SpecialFolder.UserProfile. That half is already fixed: #616 introduced BowirePaths / IBowirePathResolver as the single resolver for every storage question, and all four now go through it.

What #616 could not fix is the half a resolver does not model. The plugin directory is the one storage location a host can also point somewhere else explicitly — via Bowire:PluginDir, which --plugin-dir, BOWIRE_PLUGIN_DIR and an appsettings.json entry all bind to. That override reached the plugin loader and nothing else. Every other reader asked the resolver for its default and got an answer that is right in general and wrong on a host that was pointed elsewhere:

  • the workbench plugin listing (BowirePluginEndpoints)
  • the daily update check (PluginUpdateCheckService)
  • sidecar discovery (SidecarPluginDiscovery)
  • the bowire.plugins MCP resource (McpPaths)

And the install/update/uninstall shell-out built its child argv without the flag. The child inherits the parent's environment, so BOWIRE_PLUGIN_DIR carried across by accident and that one spelling appeared to work, while --plugin-dir and a config-file entry did not survive the process boundary at all. Which of the three ways of naming one directory worked depended on which one you picked.

Fix

BowirePluginRoot is now the one answer: the configured directory when a host set one, BowirePaths.Resolve(Data, "plugins") otherwise. Relative paths are rooted when applied, because the update check runs on a timer and has no reason to still be in the launch directory.

  • The CLI applies it from BowirePluginOptions, which keeps owning the precedence chain (--plugin-dir > BOWIRE_PLUGIN_DIR > config file > default). That type stays in the Tool: --plugin-dir is a CLI notion, and what Core needs is only the answer.
  • Embedded hosts apply it from AddBowirePlugins(IConfiguration).
  • The shell-out passes --plugin-dir explicitly. Argv construction moved into BowirePluginEndpoints.BuildPluginArgv so the list can be asserted without starting a process — the bug was entirely in what it did not contain.
  • The listing endpoint returns pluginDir, and the workbench prints that instead of asserting ~/.bowire/plugins/. Same for the bowire.plugins MCP resource description, which had been telling agents the wrong source.

Acceptance

  • Starting the host with --plugin-dir X, installing a plugin from the workbench puts it under X
  • The plugin list reads X
  • The daily update check looks at X
  • A test asserts the child-process argv carries --plugin-dir

Commits: 54d903e (resolution + shell-out + tests), 132610d (listing, MCP resource and docs describing the directory they actually use).

Activity

  1. moved this from Backlog to Done in Bowireon Aug 27, 2026
  2. thomas-stegemann commented on Aug 27, 2026

    @thomas-stegemann
    MemberAuthor

    Shipped on main, CI green on both commits.

    • 54d903ec — BowirePluginRoot as the single resolution, applied from the CLI's BowirePluginOptions and from AddBowirePlugins(IConfiguration); --plugin-dir passed explicitly to the install/update/uninstall child; argv construction extracted so it can be asserted without starting a process.
    • 132610da — the descriptions that had gone stale with it: the workbench printed a hardcoded ~/.bowire/plugins/ next to a list that came from somewhere else, and the bowire.plugins MCP resource told agents the same wrong source. The listing endpoint now returns pluginDir and both read it.

    Deliberately left out of scope: the per-user vs system-wide plugin tier split (#28 Phase D). Nothing here forecloses it — BowirePluginRoot is the single place that would grow a second tier.

  3. changed the title [-]Workbench plugin install ignores --plugin-dir — Core keeps its own hardcoded ~/.bowire/plugins[/-] [+]Workbench plugin install ignores --plugin-dir — the override reaches the loader and nothing else[/+] on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions