You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(notification-channel): let plugins provide notification destinations - #59
A plugin that sends notifications to a service such as Pushover or ntfy subscribes to notification.created and rebuilds what the host already does for webhooks: per-profile preferences, a delivery queue, retries, deduplication, failure counts and auto-disable. Only the host's built-in channels get that.
Approach
A new notification_channel.v1 capability. The plugin declares a kind of destination and its settings form (NotificationChannelDescriptor, capability descriptor field 13), checks a destination's settings (ValidateDestination), and sends one rendered message (SendNotification). Its answer tells the host whether the message was delivered, should be retried, failed, or whether the destination's settings stopped working. The host keeps preferences, the queue, retries and auto-disable.
runtime.WithNotificationChannel registers the service, and ServeManifest refuses to start a plugin that declares the capability without it. examples/hello-notification-channel posts to an ntfy topic. docs/notification-channel.md is the contract.
The settings form is one flat list of fields. People who aren't administrators fill it in, and every Silo client has to render it, so manifest.ValidateDestinationSchema refuses at install anything a client couldn't render or a host couldn't save. Loosening a rule later is additive; tightening one would break published plugins, so the rules are strict now:
Fields are string, integer, number or boolean, one form field per schema property, keyed exactly by the property name (^[A-Za-z][A-Za-z0-9_-]{0,63}$).
Controls are TEXT, PASSWORD, NUMBER, SWITCH and SELECT with static options. Sections, conditions, dynamic options, groups, multi-select and multi-line text are refused.
The schema compiles with the compiler hosts use (config.CompileSchema, new and exported), patterns are Go RE2, and $schema, $ref, combinators and additionalProperties: true are refused.
Options parse as the field's type, are unique, and equal the field's enum; only a SELECT declares enum. Defaults satisfy the field. The form's required flag matches the schema's list.
Integers stay within 2^53-1 in either direction (manifest.MaxSafeInteger), because settings travel as JSON and protobuf numbers. A secret field uses PASSWORD or TEXT.
Host behavior the guide states, because a plugin depends on it:
retry_after_seconds makes the next wait at least that long, up to a host cap of six hours.
A destination is turned off at once on DESTINATION_INVALID. Otherwise only when a message runs out of retries, or is still waiting after 36 hours, and the destination had no successful send and no edit in the meantime. A plugin that can't be reached never turns one off.
ValidateDestination can run for settings that are then not saved, and a plugin is not told when a destination is edited, turned off or deleted.
The host renders title and body; there is no recipient locale yet.
The ntfy example treats only ntfy's own JSON refusal as invalid settings. A 401 or 403 from a proxy is a retry, redirects are not followed, and header values are sanitized and encoded.
Compatibility and release
Additive. details uses the events package's Notification type from #57. A host that predates this capability refuses to install a plugin that declares it. A server without the host side doesn't offer its destinations.
Possible later additions, all additive: a destination ID and normalized settings on ValidateDestination, a recipient locale, a destination lifecycle call, and an options lookup a profile may call.
Validation
go test ./..., go vet ./... and every example build: pass. gofmt -l . lists only pkg/pluginsdk/runtime/scan_source_test.go, which is unformatted on main and not touched here. Regenerating the protobuf code with the repo's buf leaves it unchanged.
The form validator has one test case per refusal, each changing one thing on a form that passes, plus a form that uses every allowed control. The example has a test against a fake ntfy server.
Tool(s): Claude Code (implementation and orchestration); Codex CLI (independent review)
Model(s): claude-opus-5-5 (implementation and fix rounds); claude-fable-5-2 (orchestration, small fixes and independent review); gpt-6.2-astra and gpt-6.1-sol (independent review)
Involvement: Fully AI-generated, human verified
Adversarial review: claude-fable-5-2 and gpt-6.2-astra each probed the form validator for forms that install but can't be rendered or saved, and checked the guide against the host. Their findings are the form rules above and the guide's host-behavior section. An earlier gpt-6.1-sol review checked the send outcomes against the host's retry handling.
The plugin SDK adds the notification_channel.v1 capability, its protobuf service, manifest validation, and runtime registration. It also adds an ntfy example, related documentation, and tests for conversion, validation, runtime wiring, and delivery outcomes.
The protobuf definitions add notification-channel descriptors, validation and send RPCs, message fields, and delivery outcomes. The capability package and conversion code recognize and serialize the descriptor. A round-trip test checks conversion. The compatibility guide documents handling of unknown capability types.
Manifest validation checks descriptor consistency, capability IDs, display names, destination schemas, and forms. Tests cover accepted and rejected configurations. CompileSchema provides shared JSON Schema compilation and is used by ValidateValue.
Register the notification-channel service pkg/pluginsdk/runtime/*
The runtime adds WithNotificationChannel, registers the service, and exposes a client accessor. It reports an error when a manifest declares the capability without a server. Tests cover service calls and missing-server cases.
Add the ntfy example and documentation examples/hello-notification-channel/*, docs/notification-channel.md, README.md, CONTRIBUTING.md
The example validates destination settings and sends notifications to an administrator-configured ntfy server. Its manifest, tests, and README cover settings and outcomes. The capability documentation describes configuration and delivery behavior, and repository guidance adds the example build command.
The notification-channel capability and ntfy example are largely sound. The example can send its access token over plain HTTP if an administrator configures an http:// server URL. The manifest validator also accepts an integer field whose bounds contain no integer, which would make the destination impossible to create. Both are narrow and can be fixed after merge or accepted.
Security architecture risk: Minimal · up to 9f997
The inspected change establishes no material new security or failure-containment weakness. The capability is opt-in, missing service registration prevents startup, and the example keeps destination users from choosing arbitrary request hosts.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — A notification plugin is trusted with each routed destination’s credentials and notification content. Because one implementation serves all of its notification-channel capabilities, compromise of that implementation could affect the destinations routed to it across profiles, rather than only one invocation. The inspected API does not establish authority over unrelated plugins, destinations, or environments.
Trust Boundaries and Controls
observed — The ntfy example separates administrator-selected server configuration from user-selected topics. Both validation and sending enforce a topic allowlist without URL delimiters and reject non-printable token characters. The HTTP client refuses redirects, limiting user-controlled delivery to the administrator-selected endpoint rather than an arbitrary request host.
Resilience and Maintainability Implications
observed — The example uses request cancellation, a ten-second HTTP timeout, a bounded response-body read, and retry outcomes for network failures, redirects, and unrecognized proxy authorization failures. The documented host contract distinguishes plugin unavailability from destination failure and prevents a failing in-flight send from disabling a destination whose settings were subsequently saved; that concurrency safeguard remains unverified outside this repository.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the new notification-channel feature, which is the main change: a notification_channel.v1 capability that lets plugins provide notification destinations. It is a single, concise sent…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is related to the changeset. It explains the new notification_channel.v1 capability, the NotificationChannelDescriptor and ValidateDestination/SendNotification RPCs, the runtime.WithNo…
Full details: Title check
Explanation
The title names the new notification-channel feature, which is the main change: a notification_channel.v1 capability that lets plugins provide notification destinations. It is a single, concise sentence in conventional commit form and matches the changeset.
Full details: Description check
Explanation
The description is related to the changeset. It explains the new notification_channel.v1 capability, the NotificationChannelDescriptor and ValidateDestination/SendNotification RPCs, the runtime.WithNotificationChannel registration, the ntfy example, the flat destination-form validation rules, and the docs/notification-channel.md contract. It also lists validation results, compatibility notes, and related host-side work. The level of detail is high, and the content matches the summarized file changes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
NotificationChannel API comment omits its first SDK release
Without a release version, users cannot tell when NotificationChannel became available. Add its first SDK release to the API comment after verifying it against the published tags.
File pkg/pluginsdk/runtime/runtime.go, line 193:
NotificationChannel API comment omits its first SDK release
Name the first SDK release that contains NotificationChannel in this API comment. Verify the release against the published tags rather than assuming the version of an earlier service.
Kody rule violation: [Identify the actual first SDK release containing new Go APIs](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/3b921753-4a22-4967-8ee8-ac53eb6569d4?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
silo-triageBot
added
enhancement
New feature or request
go
Pull requests that update go code
triaged
High-confidence review completed; does not mean fixed, validated, or accepted for release.
labels
Nov 5, 2026
The reason will be displayed to describe this comment to others. Learn more.
Additional properties bypass the flat scalar destination restriction
Undeclared properties can contain nested objects or arrays, violating the flat scalar contract. Require additionalProperties: false or enforce the same restriction when validating destination values.
Prompt for LLM
File pkg/pluginsdk/manifest/destination_schema.go, lines 65-70:
Additional properties bypass the flat scalar destination restriction
Schemas with `additionalProperties: true` or no `additionalProperties` allow undeclared values of any type, including nested objects and arrays, so accepted destination configurations do not obey the promised flat scalar contract. Require `additionalProperties: false` or enforce the equivalent restriction when validating destination values.
The reason will be displayed to describe this comment to others. Learn more.
ValidateDestinationSchema does not identify its first SDK release
Consumers may not know which SDK version includes ValidateDestinationSchema. Add its first release to the API comment, verified against the published tags.
File pkg/pluginsdk/manifest/destination_schema.go, line 21:
ValidateDestinationSchema does not identify its first SDK release
Add the first SDK release containing `ValidateDestinationSchema` to its API comment. Verify the release against the published tags so consumers are not directed to a version that lacks this function.
Kody rule violation: [Identify the actual first SDK release containing new Go APIs](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/3b921753-4a22-4967-8ee8-ac53eb6569d4?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
Verify ntfy rejected credentials before disabling the destination
When an administrator's ntfy server sits behind a proxy or CDN that returns a 401 or 403, this branch reports DESTINATION_INVALID without checking whether ntfy actually rejected the destination's credentials. That outcome immediately disables the destination and drops the message, so a proxy-side failure can disable otherwise valid destinations instead of being retried. This contradicts the explicit proxy-401 guidance in docs/notification-channel.md. Inspect the service's error response before classifying credentials as invalid, and return RETRY for unverified intermediary refusals rather than discarding the response body first.
…ions
Add the notification_channel.v1 capability. A plugin declares a kind of
destination and its settings form, checks a destination's settings
(ValidateDestination), and sends one rendered message (SendNotification).
The host keeps preferences, the delivery queue, retries, failure counts
and auto-disable, so a Pushover or ntfy plugin no longer rebuilds them on
top of notification.created.
Register the service with runtime.WithNotificationChannel; ServeManifest
refuses to start a plugin that declares the capability without it. The
descriptor round-trips through capability records, and
examples/hello-notification-channel posts to an ntfy topic.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eep ntfy's retry wait
ValidateDestination accepted a relative server URL such as /ntfy, which
the HTTP client can't post to. It now requires an absolute http or https
URL with a host.
A Retry-After above one hour was cut to an hour, so the host could retry
before ntfy asked. The example now passes the wait through and leaves
the cap to the host.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… fields
manifest.ValidateDestinationSchema accepts one object of string, integer,
number and boolean fields and refuses $ref, combinators, conditionals,
nested objects and arrays. Destination forms are filled in by people who
aren't administrators on every client, and loosening the rule later is
additive while tightening it would break plugins. Hosts call the same
function when they accept the capability.
The docs now say retry_after_seconds is a minimum wait, give the
10-second ValidateDestination timeout, and limit DESTINATION_INVALID to a
definite refusal from the service.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng and schema checks
- Destinations have two switches, notify_next_up and notify_requests; the
retired favorites, watchlist and continue-watching filters are gone, and
watchlist arrivals (watchlist.available) go under notify_requests.
- A ValidateDestination timeout or error answers 503 with Retry-After: 30.
- A destination is disabled on DESTINATION_INVALID or an exhausted retry
schedule, but not when the plugin was unavailable for the last attempt.
- List the schema keywords the host enforces on submitted settings, the
per-server rate limit, the five-minute claim, and that details carry the
events package's Notification fields.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ontrols
Require an admin_form with at least one field, and refuse sections,
submit_label, show_when, dynamic_options, exclusive_group_field,
validation, multiline, rows, TEXTAREA, MULTI_SELECT, an unset control,
a control that doesn't fit the field type, a select without static
options, options on other controls and secret non-string fields.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Compatibility guidance omits the stored metadata reader requirement
Older stored capability metadata readers can fail when newer fields are published. Identify SDK v0.13.1 as the first version that tolerates unknown fields on this path, require older readers to upgrade first, and distinguish decoding from manifest loading without implying that loading retains unknown fields.
File docs/notification-channel.md, line 207:
Compatibility guidance omits the stored metadata reader requirement
Distinguish manifest loading from stored capability metadata decoding in this compatibility guidance. Identify SDK v0.13.1 as the first version tolerant of unknown fields on the stored metadata path, and require older metadata readers to upgrade before newer fields are published. Do not imply that manifest loading retains unknown fields.
Kody rule violation: [Scope unknown\-field compatibility to the actual Go decoding path and SDK version](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/3529b3c9-f838-4fa0-91e6-c43a54ca13e3?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
Compatibility guidance does not cover all manifest compatibility paths
Non-default fields may be serialized, and older hosts may discard fields before comparing manifests, affecting compatibility. Document minimum versions for binary manifest reads, archive installation, startup comparisons, and stored capability decoding, or cover these paths with compatibility tests.
File docs/notification-channel.md, line 207:
Compatibility guidance does not cover all manifest compatibility paths
Extend the compatibility guidance to identify the minimum supported versions for binary manifest reads, archive installation and startup manifest comparisons, and stored capability decoding. Account for non-default fields being serialized and for older hosts discarding fields before comparing manifests; alternatively, cover these paths with compatibility tests.
Kody rule violation: [Check every compatibility path when adding manifest fields](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/2c8adc32-1bd1-41e6-92a0-52a8e9fb9ead?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 3 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Share optional authentication service resolution across interface types
Find the last complete-line boundary with bounded memory
Identify the actual first SDK release containing new Go APIs
ValidateDestinationSchema accepted forms that installed but could never be
saved: a pattern outside Go RE2 syntax, select options that don't parse as
the field's type or don't match its enum, defaults that fail the field's own
checks, required flags that disagree between the form and the schema, keys
with surrounding whitespace, a $schema that switches drafts, and inverted or
misplaced bounds.
The destination schema now compiles with config.CompileSchema, the compiler
config.ValidateValue uses, and each field is checked on its own: type-scoped
keywords, ordered and non-negative bounds, RE2 patterns, unique options that
parse as the field's type and equal its enum, enum only on a SELECT, and
defaults that pass the field's checks and are one of a select's options.
Field keys match ^[A-Za-z][A-Za-z0-9_-]{0,63}$ and the form's required flag
must match the schema's required list.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ansport failures
List the rules install now enforces on a destination form, say that patterns
are Go RE2 compiled at install and that format isn't checked under draft
2020-12, and correct three host behaviours: a disabled destination stays off
until its owner turns it back on (a settings edit only clears the reason),
only a failure to reach the plugin counts as it being unavailable while a
timeout or plugin error is an ordinary failed attempt, and a message is
dropped once it is older than the retry window. State the ValidateDestination
and SendNotification time budgets.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
File pkg/pluginsdk/config/config.go, line 66:
CompileSchema does not identify its first available SDK release
Document the first SDK release that contains the new exported `CompileSchema` API. Verify the version against the published tags so consumers are not directed to a release that lacks it.
Kody rule violation: [Identify the actual first SDK release containing new Go APIs](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/3b921753-4a22-4967-8ee8-ac53eb6569d4?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
The accepted form fixture permits a numeric SELECT property
Select options are strings, so accepting a numeric property can produce incompatible values. Require a string property, update TestValidateDestinationSchemaAcceptsEveryAllowedControl and its fixture, and add a regression test rejecting numeric properties.
File pkg/pluginsdk/manifest/notification_channel_test.go, line 236:
The accepted form fixture permits a numeric SELECT property
This fixture defines a SELECT for an integer schema property, and `TestValidateDestinationSchemaAcceptsEveryAllowedControl` expects it to be accepted. Select options are stored as strings, so require a string property instead. Update the fixture and dependent tests, and add a regression test that rejects a numeric SELECT property.
Kody rule violation: [Validate select option fields against their JSON Schema types](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/f7c834a2-540c-4ca2-a474-039e03a772b9?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 3 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Share optional authentication service resolution across interface types
Find the last complete-line boundary with bounded memory
Identify the actual first SDK release containing new Go APIs
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
… with no whole number
An integer option or default beyond 2^53-1 was rounded on its way to the
plugin, so a large recipient ID could change. An integer field bounded by
0.1 and 0.9 could never be filled in. The guide states both, and separates
running out of retries from the 36-hour age cap.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Integer bounds can exclude every permitted setting value
Bounds outside the safe-integer range can pass validation even though no value can be saved. Intersect bounds.Minimum and bounds.Maximum with the safe range before checking for a whole number, including when only one bound is set.
Prompt for LLM
File pkg/pluginsdk/manifest/destination_schema.go, lines 180-182:
Integer bounds can exclude every permitted setting value
Integer bounds entirely outside `[-MaxSafeInteger, MaxSafeInteger]` still pass this check, although the new safe-integer policy leaves no value that a user can save. Intersect the bounds with the safe integer range before testing whether they contain a whole number, including when only one bound is supplied.
The reason will be displayed to describe this comment to others. Learn more.
MaxSafeInteger lacks its first available SDK release
Consumers cannot tell which SDK release first includes MaxSafeInteger. Add the first available version to its API comment, verified against published tags.
File pkg/pluginsdk/manifest/destination_schema.go, line 208:
MaxSafeInteger lacks its first available SDK release
Document the first SDK release that contains the exported `MaxSafeInteger` constant in its API comment. Verify the version against published tags so consumers are not directed to a release that lacks it.
Kody rule violation: [Identify the actual first SDK release containing new Go APIs](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/3b921753-4a22-4967-8ee8-ac53eb6569d4?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
Numeric SELECT test expects the wrong validation error
Revises an earlier Kody suggestion on pkg/pluginsdk/manifest/notification_channel_test.go:236 (2026-11-19 00:07 UTC).
The integer level property must fail SELECT type validation before the option-size check under Rule 44. Expect the non-string SELECT error, and update the shared fixture and dependent tests to use a string property for valid SELECT controls.
File pkg/pluginsdk/manifest/notification_channel_test.go, line 328:
**Revises an earlier Kody suggestion** on `pkg/pluginsdk/manifest/notification_channel_test.go:236` (2026-11-19 00:07 UTC).
Numeric SELECT test expects the wrong validation error
This case uses the integer `level` property with a SELECT control but expects validation to reach the option-size check. Rule 44 requires rejecting the SELECT because its schema property is not a string, regardless of the option value. Change the case to expect a non-string SELECT error, and update the shared fixture and dependent tests to use a string property for valid SELECT controls.
Kody rule violation: [Validate select option fields against their JSON Schema types](https://kodus.siloserver.org/settings/code-review/1247142454/kody-rules/f7c834a2-540c-4ca2-a474-039e03a772b9?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
A secret is typed, never picked: clients show it as a masked input, so a
secret select would lose its options.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A required integer with a minimum of 2^53 installed, though every value
that satisfies it is refused. The guide also says a message still waiting
after 36 hours can disable a destination under the same rule as one that
ran out of retries.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enhancementNew feature or requestgoPull requests that update go codesize/XXL1000–2999 added + deleted lines (all files); change volume, not priority.triagedHigh-confidence review completed; does not mean fixed, validated, or accepted for release.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A plugin that sends notifications to a service such as Pushover or ntfy subscribes to
notification.createdand rebuilds what the host already does for webhooks: per-profile preferences, a delivery queue, retries, deduplication, failure counts and auto-disable. Only the host's built-in channels get that.Approach
A new
notification_channel.v1capability. The plugin declares a kind of destination and its settings form (NotificationChannelDescriptor, capability descriptor field 13), checks a destination's settings (ValidateDestination), and sends one rendered message (SendNotification). Its answer tells the host whether the message was delivered, should be retried, failed, or whether the destination's settings stopped working. The host keeps preferences, the queue, retries and auto-disable.runtime.WithNotificationChannelregisters the service, andServeManifestrefuses to start a plugin that declares the capability without it.examples/hello-notification-channelposts to an ntfy topic.docs/notification-channel.mdis the contract.The settings form is one flat list of fields. People who aren't administrators fill it in, and every Silo client has to render it, so
manifest.ValidateDestinationSchemarefuses at install anything a client couldn't render or a host couldn't save. Loosening a rule later is additive; tightening one would break published plugins, so the rules are strict now:^[A-Za-z][A-Za-z0-9_-]{0,63}$).config.CompileSchema, new and exported), patterns are Go RE2, and$schema,$ref, combinators andadditionalProperties: trueare refused.enum; only a SELECT declaresenum. Defaults satisfy the field. The form'srequiredflag matches the schema's list.manifest.MaxSafeInteger), because settings travel as JSON and protobuf numbers. Asecretfield uses PASSWORD or TEXT.Host behavior the guide states, because a plugin depends on it:
retry_after_secondsmakes the next wait at least that long, up to a host cap of six hours.DESTINATION_INVALID. Otherwise only when a message runs out of retries, or is still waiting after 36 hours, and the destination had no successful send and no edit in the meantime. A plugin that can't be reached never turns one off.ValidateDestinationcan run for settings that are then not saved, and a plugin is not told when a destination is edited, turned off or deleted.titleandbody; there is no recipient locale yet.The ntfy example treats only ntfy's own JSON refusal as invalid settings. A 401 or 403 from a proxy is a retry, redirects are not followed, and header values are sanitized and encoded.
Compatibility and release
Additive.
detailsuses the events package'sNotificationtype from #57. A host that predates this capability refuses to install a plugin that declares it. A server without the host side doesn't offer its destinations.Related changes
ValidateDestination, a recipient locale, a destination lifecycle call, and an options lookup a profile may call.Validation
go test ./...,go vet ./...and every example build: pass.gofmt -l .lists onlypkg/pluginsdk/runtime/scan_source_test.go, which is unformatted onmainand not touched here. Regenerating the protobuf code with the repo'sbufleaves it unchanged.Evidence
Evidence: https://evidence.siloserver.org/r/silo-plugin-sdk/pr-59/
AI Disclosure
🤖 Generated with Claude Code