Repository navigation
[3553 by Claude Opus 5.5] Official plugin: Outbound webhooks - #3584
Conversation
…ugin interface lacked: request signing, retry hints and hosts taken from settings. All the related suites pass, including the full core, API, shared and plugins plugin suites, the Plugins page UI tests and the docs build. I did not run the full repository suite or the existing Playwright Plugins specs.
The plugin (`packages/plugins/webhooks/`)
- It subscribes to the 12 events listed in the issue and sends each one to every target whose event list and repository filter match.
- Settings have three fixed target slots, each with a URL, an event list (all events by default) and a repository filter. Each target has its own signing secret connection. The settings format can't hold a variable-length list of targets, which is why it's three slots and not "any number".
- Each request is a POST of a versioned JSON envelope with event, delivery id, timestamp and signature headers. The envelope is built from an allowlist of identifiers, links, states and scores. Free-text fields are dropped (the Ultrafix reason, the epic queue's blocked reason, and any value with spaces).
- Rate limits and server errors are retried, using the target's `Retry-After` when it gives one. Other 4xx answers and configuration errors fail the delivery at once with a message such as "Target 1 (hooks.example.com) refused the delivery with HTTP 410; it is not retried". When only some targets fail, the retry goes only to the targets that don't have the event yet.
- The event-selection helper is in `packages/plugins/_shared/`, which `plugins:check` now skips as a non-plugin folder.
Platform changes the plugin needed
- Signing: `ctx.http` can now use a `signing_secret` connection. ProPR computes the HMAC-SHA256 itself, so the handler never sees the secret.
- Hosts from settings: the manifest has a new `outboundHostsFromSettings` field, which names URL settings. A new `format: "https-url"` string setting refuses plain HTTP, IP addresses, local names and credentials in the URL. When settings are saved, a new or changed URL's host must also resolve to public addresses only. That check runs only for administrators and doesn't look up URLs that weren't changed. `ctx.http` allows only those hosts, as saved.
- Retry hints: a handler can throw a new `PluginDeliveryError` with a retry delay or as permanent. Event, webhook and command deliveries all honour it.
- Settings form: lists with fixed choices now show as checkboxes, URL settings as URL fields, and the install step names the URL settings whose hosts the plugin may call.
Behaviour change: before this, `ctx.http` refused every `signing_secret` connection. Now an unsigned request with one is refused as `invalid_input`, and I updated the one existing test that expected the old refusal. `webhooks` is also the first plugin in the catalog that isn't development-only, so it now appears on every instance.
I captured previews of the settings form at desktop and phone widths, the refused `http://` URL and the install step.
Acceptance criteria
- AC1: met — `npm run plugins:check` passes ("2 plugins checked"); `packages/plugins/webhooks/README.md` has setup steps and a manual smoke-test checklist.
- AC2: met — `packages/plugins/test/webhooks.test.ts` (one POST per matching target for every selected event, none for unselected events or filtered repositories, 429 with `Retry-After` retried after the delay, permanent 410 with a readable message); `packages/core/test/pluginWebhooksPlugin.test.ts` shows the real dispatcher scheduling the retry at exactly the `Retry-After` delay and failing a 410 at once.
- AC3: met — `docs/docs/plugins/webhooks.md` has a test vector, checked by a test in `packages/plugins/test/webhooks.test.ts`; `pluginWebhooksPlugin.test.ts` verifies the real `ctx.http` signature with the documented algorithm.
- AC4: met — save time: `packages/core/test/pluginWebhooksPlugin.test.ts` (plain HTTP, an IP address, localhost, a host that resolves to a private address) and `packages/shared/test/plugins.test.ts`; call time: the same core test (a host not derived from settings, plain HTTP, a host that later resolves privately).
- AC5: met — the sentinel test in `packages/plugins/test/webhooks.test.ts` sends all 12 events with code, logs, prompt, tool output, prose and token sentinels in the event data, and with the secret as a sentinel; none appear in any URL, header, body or log line. The core test also checks the secret never appears in the sent request.
- AC6: met — `docs/docs/plugins/webhooks.md` (envelope reference), linked from the new "Official plugins" table in `docs/docs/features/plugins.md`, plus a "Plugins" sidebar category in `docs/sidebars.ts`.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements signed outbound webhooks with substantial integration coverage, but needs changes to preserve correct per-target behavior during manual retries. ✅ Signing boundary — HMAC signing happens in core without exposing the signing secret to the handler. ✅ Endpoint restrictions — Settings validation and request-time public-address checks cover complementary parts of the outbound network boundary. ✅ Dispatcher coverage — Added integration tests exercise actual signing, delayed retries, and permanent failures through the dispatcher. This review is based on static inspection of the supplied code; no commands were run. The authoritative checks show no failures and two pending checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Preserve target progress for manual retries
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Harden the verification exampleIn ScoreThe implementation has strong endpoint controls and useful integration tests, but manual recovery mishandles partial-delivery progress. The pending checks alone do not lower the score. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit c9dcb66
Summary of ChangesI fixed F1. The webhooks plugin now remembers which targets already have an event, so a manual Retry skips those and sends to every other target. That includes a target that refused the event, so an administrator can retry after fixing it. Automatic retries still don't ask a refusing target again. How a manual Retry is recognised
Handler changes (
Docs: Regression tests
Verification: these all pass:
Lint reports no errors in the changed plugin files. Its only warnings are "file ignored" for two files outside its configuration. I did not run the docs build or the full repository suite. Nothing visible changed, so there are no previews. Review digestRisk-tiered paths
Validation evidence
Diff size: 8 files changed, +154/−24 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
… already have an event, so a manual **Retry** skips those and sends to every other target. That includes a target that refused the event, so an administrator can retry after fixing it. Automatic retries still don't ask a refusing target again. I fixed F1. The webhooks plugin now remembers which targets already have an event, so a manual **Retry** skips those and sends to every other target. That includes a target that refused the event, so an administrator can retry after fixing it. Automatic retries still don't ask a refusing target again. **How a manual Retry is recognised** - The handler couldn't tell a manual Retry from an automatic retry: both only show an attempt number. The event input now has an optional `manual: true` on the attempt a manual Retry gives. It is added in `packages/shared/src/pluginSdk.ts`, and `packages/core/src/plugins/pluginDispatcher.ts` sets it from the delivery record's existing `manual` flag. **Handler changes (`packages/plugins/webhooks/handlers.ts`)** - **Progress is kept when a delivery fails.** A delivery that ends with some targets still owed now saves which targets already have it. Before, it saved nothing when only refusals were left, so target 1 got the event again. Progress is deleted only once every target has it. - **A manual Retry clears old refusals.** It drops the saved refusals but keeps the list of targets that have the event. The second sequence in the finding (one target refused, the other busy until retries ran out) now contacts target 1 again rather than failing on its old refusal. - **Progress is kept for 14 days, not 2.** That matches how long Activity keeps deliveries and offers Retry. An old record wouldn't otherwise be dropped before a Retry can use it. - **Full plugin state no longer fails a delivery.** Keeping records longer makes the 256-key state limit easier to reach. When it is full, the oldest other progress record is dropped to make room. If that still fails, a warning is logged and the delivery's own result stands. The cost is that a later retry may resend to a target that has the event, with the same delivery id. **Docs:** `docs/docs/plugins/webhooks.md`, `docs/docs/features/plugins.md` and `docs/docs/architecture/plugin-runtime.md` now describe the manual Retry behaviour and the new `manual` field. **Regression tests** - In `packages/plugins/test/webhooks.test.ts`: both sequences from the finding; a target that refuses again on a manual Retry; and the full-state case. - In `packages/core/test/pluginWebhooksPlugin.test.ts`: the first sequence through the real dispatcher with Activity Retry, checking that target 1 isn't contacted again. - I ran the new tests against the original handler, and they fail there as expected. **Verification:** these all pass: - the plugins package tests (22 of 22) - the core webhooks, dispatcher and dispatcher-ownership suites (16 of 16) - the plugins package typecheck and the core typecheck - `plugins:check` Lint reports no errors in the changed plugin files. Its only warnings are "file ignored" for two files outside its configuration. I did not run the docs build or the full repository suite. Nothing visible changed, so there are no previews. PR: #3584 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds signed outbound webhooks with event filtering, configurable destinations, and retry handling. The implementation is well documented, but needs a localized correction to delivery progress handling before merge. ✅ Signing boundary — HMAC generation stays inside ✅ Endpoint checks — Saved target URLs undergo public-address validation, and requests resolve and validate addresses again before transport. ✅ Retry coverage — Added tests cover rate limits, permanent failures, mixed target outcomes, and manual retries. This review is based on static analysis of the supplied code; no commands were run. The authoritative checks report 29 passed, five pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F2: 🔴 Persist progress before subsequent sends
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Document progress eviction
ScoreThe signing, endpoint validation, and focused tests are strong. Deferred progress persistence leaves a reproducible timeout failure in the new multi-target delivery path; the remaining checks are pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit e4c9f8f
Summary of ChangesI fixed F2. The webhooks handler now saves which targets have the event as soon as each one answers, before it sends to the next one. If a run hits the handler's time limit partway through, the next attempt skips the targets that already accepted and sends only to the ones still owed. Fix (
Regression test (
Docs: Checks: the core webhooks test file passes (5 of 5), as do the plugin webhooks tests (11 of 11), I found nothing else outside F2 that needs reporting. There's no visual change, so I made no previews. Review digestRisk-tiered paths
Validation evidence
Diff size: 3 files changed, +41/−10 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ve the event as soon as each one answers, before it sends to the next one. If a run hits the handler's time limit partway through, the next attempt skips the targets that already accepted and sends only to the ones still owed. I fixed F2. The webhooks handler now saves which targets have the event as soon as each one answers, before it sends to the next one. If a run hits the handler's time limit partway through, the next attempt skips the targets that already accepted and sends only to the ones still owed. **Fix (`packages/plugins/webhooks/handlers.ts`)** - After each success or permanent refusal, the progress record is saved before the next send. The last target's outcome is still saved by the existing code at the end, so a delivery that succeeds everywhere on the first try writes nothing extra. - I added a `stored` flag that also counts these mid-run saves. Without it, a delivery that ended up succeeding on every target, or that ended with only refusals, could leave a progress record behind. - Transient failures are still not saved mid-run; they are retried as before. - The incremental save uses the existing `saveProgress`, which makes room when state is full. The state store's guard after a timeout is unchanged: anything that finishes after the run is cut off cannot be saved, and that part can't be avoided. What this fixes is that finished targets used to be held only in memory until the very end. **Regression test (`packages/core/test/pluginWebhooksPlugin.test.ts`)** - The new test uses the real handler runner, `ctx.http` and SQLite state. There are three targets, each answering in 150 ms, under a 400 ms handler time limit. - The first run times out while target 3 is still answering. The second attempt sends only to target 3, succeeds with all three delivered, and leaves no progress record. - I ran the new test against the previous handler and it fails: the second attempt sends to all three again and times out. To support the test, the fixture can now delay a host's answer and gained a third public test host. **Docs:** `docs/docs/plugins/webhooks.md` now says progress is kept as each target answers, so an attempt cut off by the time limit is not sent again to targets that already accepted. **Checks:** the core webhooks test file passes (5 of 5), as do the plugin webhooks tests (11 of 11), `plugins:check` and the handler typecheck. ESLint skips all three changed files (the repo's lint config doesn't cover them), so they weren't linted. I did not run the full core or repository suites. I found nothing else outside F2 that needs reporting. There's no visual change, so I made no previews. PR: #3584 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds signed outbound webhooks with event filtering, configurable destinations, and retry handling. The supplied code supports the core acceptance criteria, and I found no verified merge blocker. It is merge-ready within the reviewed scope, conditional on the three pending checks completing successfully. ✅ Signing stays inside the runtime — ✅ Destination checks cover both boundaries — Settings saves check public DNS addresses, and requests independently validate destinations and dial the vetted address. ✅ Partial retries preserve progress — Target outcomes are persisted between sends, with tests covering mixed failures, manual retries, and handler timeouts. This was a static review of the supplied diff and context; no commands or tests were run. The authoritative check summary reports 31 passed, three pending, and no failures. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Document progress eviction
S4: 🟢 Harden verification examplesThe JavaScript verifier in ScoreThe implementation has substantial coverage of signing, endpoint restrictions, and delivery recovery, with no verified blocker in the supplied code. Remaining checks are pending; runtime validation was not independently executed during this review. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met). To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge. |
AI Implementation Summary
Closes #3553
Branch:
3553/claude-opus-5-5-official-plugin-outbound--20261116-1202-yqxCommits: ✅ Changes committed (3c8d960)
AI Processing Completed
Execution Details:
Summary:
I've built the outbound webhooks plugin and added three things the plugin interface lacked: request signing, retry hints and hosts taken from settings. All the related suites pass, including the full core, API, shared and plugins plugin suites, the Plugins page UI tests and the docs build. I did not run the full repository suite or the existing Playwright Plugins specs.
The plugin (
packages/plugins/webhooks/)Retry-Afterwhen it gives one. Other 4xx answers and configuration errors fail the delivery at once with a message such as "Target 1 (hooks.example.com) refused the delivery with HTTP 410; it is not retried". When only some targets fail, the retry goes only to the targets that don't have the event yet.packages/plugins/_shared/, whichplugins:checknow skips as a non-plugin folder.Platform changes the plugin needed
ctx.httpcan now use asigning_secretconnection. ProPR computes the HMAC-SHA256 itself, so the handler never sees the secret.outboundHostsFromSettingsfield, which names URL settings. A newformat: "https-url"string setting refuses plain HTTP, IP addresses, local names and credentials in the URL. When settings are saved, a new or changed URL's host must also resolve to public addresses only. That check runs only for administrators and doesn't look up URLs that weren't changed.ctx.httpallows only those hosts, as saved.PluginDeliveryErrorwith a retry delay or as permanent. Event, webhook and command deliveries all honour it.Behaviour change: before this,
ctx.httprefused everysigning_secretconnection. Now an unsigned request with one is refused asinvalid_input, and I updated the one existing test that expected the old refusal.webhooksis also the first plugin in the catalog that isn't development-only, so it now appears on every instance.I captured previews of the settings form at desktop and phone widths, the refused
http://URL and the install step.Acceptance criteria
npm run plugins:checkpasses ("2 plugins checked");packages/plugins/webhooks/README.mdhas setup steps and a manual smoke-test checklist.packages/plugins/test/webhooks.test.ts(one POST per matching target for every selected event, none for unselected events or filtered repositories, 429 withRetry-Afterretried after the delay, permanent 410 with a readable message);packages/core/test/pluginWebhooksPlugin.test.tsshows the real dispatcher scheduling the retry at exactly theRetry-Afterdelay and failing a 410 at once.docs/docs/plugins/webhooks.mdhas a test vector, checked by a test inpackages/plugins/test/webhooks.test.ts;pluginWebhooksPlugin.test.tsverifies the realctx.httpsignature with the documented algorithm.packages/core/test/pluginWebhooksPlugin.test.ts(plain HTTP, an IP address, localhost, a host that resolves to a private address) andpackages/shared/test/plugins.test.ts; call time: the same core test (a host not derived from settings, plain HTTP, a host that later resolves privately).packages/plugins/test/webhooks.test.tssends all 12 events with code, logs, prompt, tool output, prose and token sentinels in the event data, and with the secret as a sentinel; none appear in any URL, header, body or log line. The core test also checks the secret never appears in the sent request.docs/docs/plugins/webhooks.md(envelope reference), linked from the new "Official plugins" table indocs/docs/features/plugins.md, plus a "Plugins" sidebar category indocs/sidebars.ts.Review digest
Acceptance criteria (6 of 6 met, as stated by the agent)
The plugin passes `plugins:check` and has a README with setup steps and a manual smoke-test checklist.—`npm run plugins:check` passes ("2 plugins checked"); `packages/plugins/webhooks/README.md` has setup steps and a manual smoke-test checklist.Handler tests with the plugin test kit: every selected event produces one POST to each matching target; unselected events and filtered repositories produce none; a 429 with `Retry-After` is retried after the delay; a permanent error marks the delivery failed with a readable message.—`packages/plugins/test/webhooks.test.ts` (one POST per matching target for every selected event, none for unselected events or filtered repositories, 429 with `Retry-After` retried after the delay, permanent 410 with a readable message); `packages/core/test/pluginWebhooksPlugin.test.ts` shows the r…The signature is verifiable with the documented algorithm (test vector in the docs).—`docs/docs/plugins/webhooks.md` has a test vector, checked by a test in `packages/plugins/test/webhooks.test.ts`; `pluginWebhooksPlugin.test.ts` verifies the real `ctx.http` signature with the documented algorithm.A target URL to a private address or plain HTTP is refused at save time; a host not derived from the settings is refused at call time.—save time: `packages/core/test/pluginWebhooksPlugin.test.ts` (plain HTTP, an IP address, localhost, a host that resolves to a private address) and `packages/shared/test/plugins.test.ts`; call time: the same core test (a host not derived from settings, plain HTTP, a host that later resolves privatel…No payload contains code, logs, prompt text, tool output or credentials (sentinel test).—the sentinel test in `packages/plugins/test/webhooks.test.ts` sends all 12 events with code, logs, prompt, tool output, prose and token sentinels in the event data, and with the secret as a sentinel; none appear in any URL, header, body or log line. The core test also checks the secret never appear…Docs: `docs/docs/plugins/webhooks.md` with the envelope reference, linked from `docs/docs/features/plugins.md`.—`docs/docs/plugins/webhooks.md` (envelope reference), linked from the new "Official plugins" table in `docs/docs/features/plugins.md`, plus a "Plugins" sidebar category in `docs/sidebars.ts`.Risk-tiered paths
packages/api/openapi/schemasPlugins.ts(+2/−1)packages/client/src/generated/apiTypes.ts(+6/−2)packages/core/src/plugins/pluginCommandDeliveries.ts(+3/−4)packages/core/src/plugins/pluginContext.ts(+9/−4)packages/core/src/plugins/pluginDeliveries.ts(+15/−1)packages/core/src/plugins/pluginDispatcher.ts(+7/−6)packages/core/src/plugins/pluginHandlerRunner.ts(+16/−2)packages/core/src/plugins/pluginHttp.ts(+58/−6)packages/core/src/plugins/pluginSettingHosts.ts(added, +50/−0)packages/core/src/plugins/pluginStore.ts(+20/−0)packages/core/src/plugins/pluginWebhookRunner.ts(+2/−3)packages/plugins/_shared/eventSelection.ts(added, +53/−0)packages/plugins/registry.json(+1/−0)packages/plugins/testing/index.ts(+38/−7)packages/plugins/webhooks/envelope.ts(added, +134/−0)packages/plugins/webhooks/handlers.ts(added, +113/−0)packages/plugins/webhooks/icon.svg(added, +1/−0)packages/plugins/webhooks/manifest.json(added, +260/−0)packages/shared/src/pluginInstallations.ts(+10/−2)packages/shared/src/pluginSdk.ts(+61/−2)packages/shared/src/plugins.ts(+87/−4)propr-ui/src/pages/PluginsPage/PluginSettingFields.tsx(+38/−2)propr-ui/src/pages/PluginsPage/pluginFixtures.testUtils.tsx(+1/−1)propr-ui/src/pages/PluginsPage/pluginUi.ts(+8/−0)scripts/check-plugins.mjs(+4/−3)docs/docs/architecture/plugin-runtime.md(+37/−8)docs/docs/features/plugins.md(+51/−8)docs/docs/plugins/webhooks.md(added, +243/−0)docs/sidebars.ts(+8/−0)docs/static/openapi/propr-api.yaml(+14/−2)packages/core/test/pluginHandlerRunner.test.ts(+25/−2)packages/core/test/pluginWebhooksPlugin.test.ts(added, +193/−0)packages/plugins/test/registry.test.ts(+14/−5)packages/plugins/test/testing.test.ts(+19/−0)packages/plugins/test/webhooks.test.ts(added, +251/−0)packages/plugins/webhooks/README.md(added, +77/−0)packages/shared/test/plugins.test.ts(+42/−1)propr-ui/e2e/plugins.fixture.ts(+1/−1)propr-ui/src/pages/PluginsPage/PluginSettingsForm.test.tsx(+26/−0)propr-ui/src/pages/PluginsPage/pluginUi.test.ts(+12/−0)test/checkPlugins.test.mjs(+7/−1)Validation evidence
Diff size: 41 files changed, +2,017/−78 lines
Detailed Logs:
f7e41a91-f50a-46d3-9374-d9cbf1bcf1ddLog files stored at:
/usr/src/app/logs/executions/issue-3553-2026-11-16T12-27-39-271Z-conversation.json/usr/src/app/logs/executions/issue-3553-2026-11-16T12-27-39-271Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3553.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Install step: what the plugin adds
The catalog install step lists the subscribed events and that the plugin sends requests only to the hosts of the target URL settings.
Full-size original
Outbound webhooks settings (desktop)
The Configure step generated from the webhooks manifest: Target 1 URL as a URL field, Target 1 events as checkboxes (multiple choice), the repository filter, and the next target slot.
Full-size original
Outbound webhooks settings (phone)
The same settings form at 390 px width.
Full-size original
Plain HTTP target refused (phone)
Saving http:// as Target 1 URL is refused on the field with 'target1Url must be an https:// URL, not http'; event checkboxes in one column at 390 px.
Full-size original