Skip to content

Plugin event subscriptions: dispatcher, retries, health and the Activity list #3549

Open

Description

@integry

Goal

Deliver repository events to plugin handlers reliably, without ever affecting the work that produced the event, and show what happened.

Event subscriptions

  • Manifest: contributes.subscriptions: [{ on: '<domain>.<type>', handler: '<name>', filter?: {...} }].
  • Source: the repository event journal (domains pull_request, epic_queue, plan_issue, task).
  • Delivery: a dispatcher in the worker process reads the journal with a durable cursor per installation. At-least-once delivery; each delivery carries a stable id so handlers can de-duplicate. Events for one repository are delivered to one plugin in order, one at a time. Handler timeout 30 seconds. On failure retry with backoff (for example 1 min, 5 min, 30 min, 2 h), then mark the delivery failed and continue with the next event. Events older than the journal's retention are skipped with a recorded gap. Installing a plugin starts its cursor at "now"; it does not replay history. Events outside the plugin's repository limit are not delivered.
  • When several workers run, only one delivers per installation (lease row).
  • Health: an installation with repeated failures is shown as Degraded with the last error; after a configurable number of consecutive failures deliveries pause until an administrator presses Resume. Administrators get one notification when a plugin becomes Degraded.
  • A handler failure, timeout or crash never fails or delays the task, review, merge or queue step that produced the event.

Activity

Each delivery is recorded: time, kind, handler, outcome, duration, attempt, error message, log lines. Retained for a bounded period. API routes list an installation's deliveries and retry a failed one. The Plugins page Activity list shows them with a Retry action, and the detail page shows Degraded with Resume. No event payload bodies beyond the event id and type, and no credentials, are stored.

Acceptance criteria

  • With a test plugin: a subscribed handler runs once per matching event, in order per repository; filters are honoured; a failing handler is retried on the schedule and then marked failed; the cursor survives a worker restart without loss; duplicate delivery ids are stable.
  • A handler that throws, hangs past the timeout or exhausts retries does not affect the originating flow (test with a handler on pull_request.merged).
  • Two dispatchers running at once deliver each event once (lease test).
  • Degraded state, pause after repeated failures, Resume and the single notification work.
  • Activity entries are recorded and visible through the API; the Plugins page shows them with Retry.
  • Docs: events list with payloads, delivery guarantees and limits in docs/docs/features/plugins.md and docs/docs/architecture/plugin-runtime.md.

Implementation

  1. Core: packages/core/src/plugins/pluginDispatcher.ts (cursor table, ordering, retry schedule, lease), pluginDeliveries.ts (activity records, retention). Knex migration for cursors and deliveries.
  2. Worker: start the dispatcher from src/daemon.ts with the journal retention job.
  3. API: activity and resume routes in a plugin activity route module; OpenAPI regeneration.
  4. UI: PluginActivity and the Degraded / Resume state.
  5. Tests with a fixture plugin in packages/core/test and packages/api/test; component test for the Activity list.

Notes

Depends on the handler context issue and the task domain issue. ProPR runs on SQLite only: the lease is a row with an expiry, not a database lock feature.

Activity

  1. added
    base-3542-epic-plugin-system-xu8
    on Nov 14, 2026
  2. propr-dev commented on Nov 15, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3549/claude-opus-5-5-plugin-event-subscription-20261115-1434-1ne
    • Base Branch: 3542-epic-plugin-system-xu8
    • Worktree: issue-3549-20261115-1434-claude-opus-5-5-1ne

    🔍 Track Task Execution

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

    AI-doneauto-mergebase-3542-epic-plugin-system-xu8llm-claude-opus55propr-planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions