Repository navigation
Conversation
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| } | ||
|
|
||
| // NotificationChannel returns the client for notification_channel.v1 | ||
| // destinations. Plugins that don't serve it answer Unimplemented. |
There was a problem hiding this comment.
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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
1 similar comment
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| 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") | ||
| } | ||
| } |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
…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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
… 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 <noreply@anthropic.com>
68d0a07 to
36624d4
Compare
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
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-profilepreferences, 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 itssettings form (
NotificationChannelDescriptor, capability descriptor field 13), checks adestination's settings (
ValidateDestination), and sends one rendered message(
SendNotification). Its answer tells the host whether the message was delivered, should beretried, 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 aplugin that declares the capability without it.
examples/hello-notification-channelposts to anntfy topic, and
docs/notification-channel.mdcovers the contract and the host's retry window.The settings form is a flat list of scalar fields: one object of string, integer, number or
boolean properties, with no
$ref, combinators, conditionals, nested objects or arrays. People whoaren't administrators fill it in on every client, and loosening the rule later is additive, while
tightening it would break published plugins.
manifest.ValidateDestinationSchemaenforces it, andhosts call the same function when they accept the capability.
The docs spell out three host behaviors a plugin depends on:
retry_after_secondssets a minimumwait and never shortens the retry schedule;
ValidateDestinationhas 10 seconds; andDESTINATION_INVALIDdisables the destination on the first answer, so a plugin returns it only fora definite refusal from the service, never for a proxy 401, a timeout or a 5xx.
Compatibility and release
Merge after #57:
detailsis described as the events package'sNotificationtype, which #57adds.
Additive. A plugin that declares this capability needs a Silo server that includes
Silo-Server/silo-server#2502: an older server refuses to install it from a bare binary and won't
start it from an archive, because it doesn't know the descriptor field. A server without the host
side of this capability doesn't offer its destinations.
Related changes
buf generate.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.
bufleaves it unchanged.make protoitself stopsat its
protoccheck on this machine, though generation doesn't useprotoc.server: settings refusal with the plugin's message, test message, a real notification delivered
through the host's queue, a retry after the server was unreachable, and auto-disable when the
service refused the token.
Evidence
Evidence: https://evidence.siloserver.org/r/silo-plugin-sdk/pr-59/
AI Disclosure
host's retry handling. It found the docs' retry window didn't match the host's schedule; fixed.
🤖 Generated with Claude Code
Note
Add
notification_channel.v1capability for plugin-provided notification destinationsnotification_channel.v1capability type with a protobufNotificationChannelservice (ValidateDestinationandSendNotificationRPCs) in notification_channel.proto, plus aNotificationChannelDescriptoronCapabilityDescriptor(field 13)WithNotificationChannelServeManifestoption in serve_manifest.go;manifestServeConfigerrors when a manifest declares the capability without a non-nil server.runtime.Client.NotificationChannelexposes a client on the host sideRetry-Aftersupport, failed), and docs in notification-channel.mdmanifest.Validatenow rejects destination schemas with nested objects, arrays, references, or conditionals — existing manifests that previously passed with such schemas will fail validationMacroscope summarized 36624d4.