Skip to content

feat(notification-channel): let plugins provide notification destinations - #59

Merged
Quick104 merged 18 commits into
mainfrom
feat/notification-channel
Nov 19, 2026
Merged

Quick104 merged 18 commits into
mainfrom
feat/notification-channel

Conversation

@Quick104

@Quick104 Quick104 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

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.

Related changes

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.
  • The host ran a scriptable plugin and this example end to end on an isolated sandbox with two API servers (feat(notifications): deliver to plugin-provided notification destinations silo-server#3550 lists the cases). Building that test plugin's first manifest, the validator refused ten mistakes with a message each.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-plugin-sdk/pr-59/

AI Disclosure

  • Harness: Claude Code, run from T3 Code
  • 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.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

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.

Changes: Notification channel capability

Layer / File(s) Summary
Define notification-channel contracts
proto/silo/plugin/v1/common.proto, proto/silo/plugin/v1/notification_channel.proto, pkg/pluginsdk/capability/capability.go, pkg/pluginsdk/convert/*, pkg/pluginsdk/events/payloads.go, docs/compatibility.md
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.
Validate notification-channel manifests
pkg/pluginsdk/config/config.go, pkg/pluginsdk/manifest/*
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.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Silo
  participant NtfyPlugin
  participant NtfyServer
  Silo->>NtfyPlugin: SendNotification request
  NtfyPlugin->>NtfyServer: POST notification to configured server and topic
  NtfyServer-->>NtfyPlugin: HTTP response
  NtfyPlugin-->>Silo: Delivery outcome and retry delay
Loading

Possibly related PRs

Merge Risk: Low · up to 9f997

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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

@silo-triage silo-triage Bot added the size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. label Nov 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T01:50:57.336927Z 23b6693 New commits
🔒 Security Review ✅ Completed 2026-11-19T01:53:39.239470Z 23b6693 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread pkg/pluginsdk/convert/convert.go Resolved
Comment thread pkg/pluginsdk/runtime/runtime.go Resolved
}

// NotificationChannel returns the client for notification_channel.v1
// destinations. Plugins that don't serve it answer Unimplemented.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules low

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.

Kody rule violation: Identify the actual first SDK release containing new Go APIs

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@silo-kody

silo-kody Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

1 similar comment
@silo-kody

silo-kody Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment on lines +65 to +70
if raw, ok := root["additionalProperties"]; ok {
var allowed bool
if err := json.Unmarshal(raw, &allowed); err != nil {
return fmt.Errorf("destination_schema additionalProperties must be a boolean")
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

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.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

destinationFieldTypes = []string{"string", "integer", "number", "boolean"}
)

// ValidateDestinationSchema checks a notification_channel destination_schema:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules low

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.

Kody rule violation: Identify the actual first SDK release containing new Go APIs

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@Quick104
Quick104 force-pushed the feat/notification-channel branch from 68d0a07 to 36624d4 Compare November 18, 2026 15:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36624d4648

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +124 to +125
case resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden:
return outcome(pluginv1.NotificationSendOutcome_NOTIFICATION_SEND_OUTCOME_DESTINATION_INVALID, "ntfy refused the access token for this topic."), nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.

Useful? React with 👍 / 👎.

Quick104 and others added 4 commits November 18, 2026 22:26
…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]>
@Quick104
Quick104 force-pushed the feat/notification-channel branch from 36624d4 to 7ab31d9 Compare November 18, 2026 22:26
…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]>
@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Quick104 and others added 3 commits November 18, 2026 22:46
…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]>
@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌


## Compatibility

A Silo server whose SDK predates `notification_channel.v1` refuses to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

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.

Kody rule violation: Scope unknown-field compatibility to the actual Go decoding path and SDK version

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​


## Compatibility

A Silo server whose SDK predates `notification_channel.v1` refuses to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

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.

Kody rule violation: Check every compatibility path when adding manifest fields

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review 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

Quick104 and others added 2 commits November 19, 2026 00:04
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]>
@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

// 2020-12 unless the schema names another with $schema, and Go regexp
// (RE2) syntax for pattern. Manifest validation uses it to refuse a schema
// a host could never check values against.
func CompileSchema(schemaJSON string) (*jsonschema.Schema, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules low

CompileSchema does not identify its first available SDK release

Consumers need to know which SDK release includes CompileSchema. Document the first release after verifying it against the published tags.

Kody rule violation: Identify the actual first SDK release containing new Go APIs

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

{Key: "ratio", Label: "Ratio", Control: pluginv1.AdminFormControl_ADMIN_FORM_CONTROL_NUMBER, DefaultValue: structpb.NewNumberValue(0.5)},
{Key: "markdown", Label: "Markdown", Control: pluginv1.AdminFormControl_ADMIN_FORM_CONTROL_SWITCH, DefaultValue: structpb.NewBoolValue(true)},
{Key: "server", Label: "Server", Control: pluginv1.AdminFormControl_ADMIN_FORM_CONTROL_SELECT, Options: []*pluginv1.AdminFormOption{{Value: "a", Label: "A"}, {Value: "b", Label: "B"}}},
{Key: "level", Label: "Level", Control: pluginv1.AdminFormControl_ADMIN_FORM_CONTROL_SELECT, DefaultValue: structpb.NewNumberValue(2), Options: []*pluginv1.AdminFormOption{{Value: "1", Label: "Low"}, {Value: "2", Label: "High"}}},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

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.

Kody rule violation: Validate select option fields against their JSON Schema types

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a067993d-bfa5-409f-9358-bf17ff9ae5fd
Commits

Reviewing files that changed from the base of the PR and between 7c5836c and 9f99756.

Files selected for processing: 5

  • docs/notification-channel.md
  • examples/hello-notification-channel/main_test.go
  • pkg/pluginsdk/config/config.go
  • pkg/pluginsdk/manifest/destination_schema.go
  • pkg/pluginsdk/manifest/notification_channel_test.go

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.

Quick104 and others added 2 commits November 19, 2026 01:13
… 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]>
@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment on lines +180 to +182
// An integer field whose bounds hold no whole number can never be filled in.
if p.typ == "integer" && bounds.Minimum != nil && bounds.Maximum != nil && math.Ceil(*bounds.Minimum) > math.Floor(*bounds.Maximum) {
return nil, fmt.Errorf("destination_schema field %q has no whole number between minimum %v and maximum %v", name, *bounds.Minimum, *bounds.Maximum)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

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.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

// MaxSafeInteger is the largest whole number a setting carries exactly:
// settings travel as JSON numbers and protobuf values, which are doubles.
// Hosts refuse an integer setting beyond it in either direction.
const MaxSafeInteger = 1<<53 - 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules low

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.

Kody rule violation: Identify the actual first SDK release containing new Go APIs

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

{name: "integer option too large to carry exactly", schema: replace(`"level":{"type":"integer","enum":[1,2]}`, `"level":{"type":"integer"}`),
form: func(form *pluginv1.AdminFormDescriptor) {
field(form, "level").Options[1].Value = "9007199254740993"
}, wantErr: "outside the whole numbers a setting can hold exactly"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

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.

Kody rule violation: Validate select option fields against their JSON Schema types

Prompt for LLM
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)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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]>
@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

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]>
@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit d6662f8 into main Nov 19, 2026
4 checks passed
@Quick104
Quick104 deleted the feat/notification-channel branch November 19, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant