Repository navigation
Open
Labels
AI-doneauto-mergebase-3542-epic-plugin-system-xu8Base branch label for Epic: Plugin system: manifest, handlers, commands and official pluginsllm-claude-opus55propr-planned
Description
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.mdanddocs/docs/architecture/plugin-runtime.md.
Implementation
- Core:
packages/core/src/plugins/pluginDispatcher.ts(cursor table, ordering, retry schedule, lease),pluginDeliveries.ts(activity records, retention). Knex migration for cursors and deliveries. - Worker: start the dispatcher from
src/daemon.tswith the journal retention job. - API: activity and resume routes in a plugin activity route module; OpenAPI regeneration.
- UI:
PluginActivityand the Degraded / Resume state. - Tests with a fixture plugin in
packages/core/testandpackages/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.
Metadata
Metadata
Assignees
Labels
AI-doneauto-mergebase-3542-epic-plugin-system-xu8Base branch label for Epic: Plugin system: manifest, handlers, commands and official pluginsllm-claude-opus55propr-planned
Activity
propr-dev commentedon Nov 15, 2026
🤖 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:
claudeclaude-opus-5-53549/claude-opus-5-5-plugin-event-subscription-20261115-1434-1ne3542-epic-plugin-system-xu8issue-3549-20261115-1434-claude-opus-5-5-1ne🔍 Track Task Execution