Skip to content

[Bug]: Existing-project plugin selection is dropped and restricted pipeline grants are ignored #6186

Description

@itlackey

Before you submit

  • I searched existing issues and confirmed this is not a duplicate.
  • I replaced the example text with the real behavior, reproduction steps, expected result, and version from the app's About menu or od --version.

What happened?

Two related host defects prevent pipeline plugins from reliably reaching existing-project runs:

  1. POST /api/plugins/:id/apply correctly returns a pure snapshot with snapshotId: "", but the web send path forwards only that empty ID. /api/runs receives neither pluginId nor pluginInputs, so the selected plugin is omitted or an older project pin is reused.
  2. A restricted plugin with od.pipeline.stages requires pipeline:*, but the trust endpoint rejects that exact capability. If the grant is otherwise persisted, applyPlugin() recomputes defaults instead of using capabilitiesGranted, so the grant is ignored and revoked trusted capabilities can reappear.

Steps to reproduce

  1. Install a plugin with od.pipeline.stages and attach it from an existing project's composer.
  2. Send a message and inspect POST /api/runs; the request has no plugin identity or inputs because pure apply returned an empty snapshot ID.
  3. Install the same plugin from a URL/GitHub source so it is restricted.
  4. Run od plugin trust <id> --capabilities pipeline:*; the daemon returns invalid-capability.
  5. Persist the grant directly and apply again; the snapshot still uses recomputed trust defaults rather than the stored grants.

Expected behavior

When pure apply has no snapshot ID, the existing-project run should send pluginId and pluginInputs so the daemon can persist and pin the snapshot. pipeline:* should be a valid persistent grant, and apply should honor stored grants while retaining the prompt:inject floor.

Open Design version

0.16.1, reproduced on main at f52fda29a

Platform

Linux

Logs (optional)

POST /api/plugins/<id>/trust -> 400 invalid-capability: pipeline:*
POST /api/runs -> 409 capabilities-required after the grant is stored

Screenshots (optional)

Not applicable.

Additional context

Reproduced with a real custom publishing plugin and isolated daemon data. Relevant paths are ProjectView.tsx -> providers/daemon.ts -> /api/runs, plus plugins/trust.ts and plugins/apply.ts. Focused regression tests and an imported-project fake-agent run confirm the expected behavior.

Note: I did use opencode and GPT 5.6 Sol to do this investigation and a PR with fixes for the issues I ran into testing a custom plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions