Skip to content

fix(markers): let marker plugins opt out of contributions - #1785

Merged
Quick104 merged 4 commits into
Silo-Server:mainfrom
blurbery:fix/marker-plugin-fetch-only
Oct 21, 2026
Merged

Quick104 merged 4 commits into
Silo-Server:mainfrom
blurbery:fix/marker-plugin-fetch-only

Conversation

@blurbery

@blurbery blurbery commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A. Split out of #792.
Validation tasks: none

A marker plugin that only reads markers, such as a public or anonymous provider, is still treated as a contributor. The plugin gRPC service has submit methods whether or not the provider accepts submissions, so every plugin provider implements markers.Submitter. Contribution then sends it submission jobs, and the admin API offers it contribution settings and user stats it can't support.

This change lets a marker capability declare supports_contribution: false in its capability metadata. Silo then registers it as fetch-only.

Approach

  • On reload, a capability whose metadata has supports_contribution: false is wrapped in markers.ReadOnlyPluginProvider. The wrapper forwards ID, CacheRevision, ProviderDescription and FetchMarkers and nothing else, so the existing Submitter assertions in contribution and the admin API follow the manifest.
  • CacheRevision has to be forwarded. Population keys its cache on it, and reload compares it to decide whether to refresh the plugin runtime.
  • A manifest without the key, or with a value that isn't a boolean or a parseable string, keeps today's submitter behaviour, so existing plugins are unaffected.
  • A provider keeps the sharing flags it saved while it was a submitter. The nightly "Share intro markers" task now skips configured providers that aren't registered as submitters, so those flags can't make it rescan every candidate file without submitting. The admin tile shows sharing as off for a non-submitter.

The flag sits next to default_fetch_priority and required_external_ids in the capability's metadata object. Plugin authors will need it documented with those keys in the plugin SDK docs. I haven't changed the SDK in this PR.

Validation

  • go test ./internal/markers/ ./cmd/silo/ -count=1 and go test ./internal/api/handlers/ -run Marker -count=1 pass.
  • go vet ./cmd/silo ./internal/markers is clean.
  • Tests cover the metadata parsing, the wrapper hiding SubmissionRequirementProvider and forwarding CacheRevision, a reload with a fetch-only manifest registering a non-submitter, and the share task skipping a fetch-only provider with saved sharing flags. The reload test and the share-task row both fail on code without their fix.
  • The branch was brought up to date with main by a merge commit.

Benchmarks

Not applicable. This changes which interface a provider is registered behind.

Evidence

Evidence: none, no user-visible change. No marker plugin sets supports_contribution: false yet, so every existing install keeps today's settings screen. The contribution controls only change once a plugin opts in, and there's no fetch-only plugin to capture that against yet.

Risks

None identified. The key is opt-in and additive. A plugin that sets it loses the contribution UI and jobs, which is the intent.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

Note

Let marker plugins opt out of contributions via supports_contribution metadata

  • Adds markers.ReadOnlyPluginProvider, a fetch-only wrapper that hides submission methods. Providers registered in reloadMarkerPluginProviders use this wrapper when the plugin's capability metadata sets supports_contribution to false; absent, unsupported, or unparseable values default to true for compatibility (plugin_provider.go).
  • Adds markers.ContributionService.AcceptsContributions, which reports whether a provider ID has Submitter support. tasks.ContributeMarkersTask.Execute now skips providers that do not accept contributions, even if their saved auto-contribution flags are still enabled (contribute.go, contribute_markers.go).
  • The admin provider tile shows the contribution and auto-local-sharing toggles as off and disabled for non-submitter providers (MarkerProviderTiles.tsx).
  • Behavioral Change: plugins with explicit supports_contribution: false no longer satisfy the Submitter interface, so their saved contribution settings are ignored during automatic marker contribution.

Macroscope summarized a7aa296.

The plugin gRPC service carries submit methods whether or not a marker
provider accepts submissions, so every plugin provider implemented
Submitter and fetch-only providers received contribution jobs and were
offered contribution settings. A capability can now declare
supports_contribution=false in its metadata; reload wraps it in a
fetch-only provider that forwards ID, CacheRevision, description and
FetchMarkers only. Manifests without the key keep today's behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 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 ✅

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7125c5a5-c50e-4b72-8693-51e4b0673cb0
📥 Commits

Reviewing files that changed from the base of the PR and between b4cf819 and 8ddb552.

📒 Files selected for processing (4)
  • cmd/silo/main.go
  • cmd/silo/marker_plugin_migration_test.go
  • internal/markers/plugin_provider.go
  • internal/markers/plugin_provider_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Plugin provider registration now checks contribution metadata. Providers that explicitly disable contribution use a read-only wrapper; missing or unrecognized metadata continues to indicate support.

Changes: Marker plugin contribution support

Layer / File(s) Summary
Provider capability and read-only wrapper
internal/markers/plugin_provider.go, internal/markers/plugin_provider_test.go
PluginSupportsContributionFromMetadata parses boolean and string values. Missing, invalid, or other-typed values default to support. ReadOnlyPluginProvider delegates provider details and marker fetching without exposing submission methods. Tests cover delegation and metadata cases.
Provider registration by capability
cmd/silo/main.go, cmd/silo/marker_plugin_migration_test.go
Provider reload registers providers directly when contribution is supported and wraps them as read-only otherwise. Reload tests cover missing metadata and explicit false.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to 8ddb5

Plugins that opt out remain available for marker fetching without receiving contribution submissions. No actionable merge-blocking risk was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: marker plugins can opt out of contributions.
Description check Passed The description directly explains the problem, implementation, compatibility behavior, validation, and intended effect of the changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Oct 2, 2026

Copy link
Copy Markdown

Validation tasks: none (no validation task covers marker contribution routing) needs correction: silo-server #1148 C2 tests marker-provider plugin supply/accept operations, though it is currently Not run. This PR preserves submission behavior for providers without an explicit opt-out and delegates fetches. Because #1148 C2 has no recorded result, there is nothing to invalidate or unblock; the line can be Validation tasks: none (no recorded result is affected).

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@silo-kody

silo-kody Bot commented Oct 2, 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 ✅

@blurbery

blurbery commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, updated the description to Validation tasks: changes #1148 C2 (Not run).

Quick104 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Silo's pull request guidance changed today (#2016). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Evidence: none, no user-visible change. This PR was opened before the rule existed, so it hasn't had a chance to meet it yet.

Missing here: Before-and-after screenshots of the admin marker provider settings for a fetch-only plugin showing the contribution controls gone, or, if nothing changes until a plugin opts in, the line 'Evidence: none, no user-visible change' with that reason.

The rules are in Show visible changes, and the PR template shows the Evidence section layout. I've converted this PR to draft for now. Mark it ready for review once the Evidence section is filled in.


Generated by Claude Code

@Quick104
Quick104 marked this pull request as draft October 6, 2026 19:25
@blurbery
blurbery marked this pull request as ready for review October 6, 2026 20:04
@macroscopeapp

macroscopeapp Bot commented Oct 6, 2026

Copy link
Copy Markdown

This change is visible in Admin → Providers: for a plugin that opts out, the marker settings disable the sharing controls and omit “Test connection” and submission stats. The Evidence section says there is no user-visible change, so it lacks evidence for this opt-in case. Please add before-and-after screenshots of the same marker-provider settings screen and data, and identify the surface and build or commit for each capture.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@blurbery

blurbery commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

The Evidence section covers this now. No marker plugin sets supports_contribution: false yet, so every existing install keeps today's settings screen. The contribution controls only change once a plugin opts in, and there's no fetch-only plugin to capture that against yet.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 8ddb552. Two findings are inline. I'm fixing both on this branch, and a summary comment will follow.

The approach holds up. Before this change every registered marker provider is a PluginProvider, so every one is a Submitter. Each place that asks whether a provider takes contributions uses that type assertion: contribution dispatch, SubmissionRequirementProvider, the admin is_submitter flag, and validate. Wrapping at registration makes all of them follow the manifest. The wrapper forwards everything callers assert on current main (DescribedProvider, CacheRevision), and the branch merges cleanly with main. TestReloadMarkerPluginProvidersHonorsSupportsContribution fails on the base for the expected reason and passes on this head.

Comment thread cmd/silo/main.go Resolved
Quick104 and others added 2 commits October 21, 2026 10:47
A provider keeps its saved sharing flags after a plugin update declares
supports_contribution=false. The share task picked providers from those
flags alone, so it rescanned every candidate file each night without
submitting anything. It now skips providers the registry doesn't hold as
submitters, and the admin tile shows sharing as off for them.

Trim the new tests to what the reload test doesn't already cover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: a7aa296 (originally 8ddb552)

The approach is right. Before this change every marker plugin registered as a Submitter, and every place that decides whether a provider takes contributions uses that type check: contribution dispatch, submission requirements, the admin is_submitter flag, and validate. Wrapping the provider at registration makes all of them follow the manifest, and the wrapper forwards everything callers use on current main.

Addressed on this branch

  • Merged main into the branch with a merge commit. Nothing was rewritten.
  • Stale sharing flags kept the nightly share task busy (medium). A provider that became fetch-only kept its saved contribute_enabled / contribute_auto_local. "Share intro markers" picked providers from those flags alone, so it reloaded and resolved every candidate file each night and submitted nothing. The admin tile also showed both toggles on but locked. In a7aa296 the task skips providers that aren't registered submitters, and the tile shows sharing as off for them.
  • Tests trimmed (low) to what the reload test doesn't already cover, per the test rules in AGENTS.md.

Tests that failed on the base

  • TestReloadMarkerPluginProvidersHonorsSupportsContribution fails on the PR's base for the expected reason: the fetch-only provider still implements Submitter.
  • The new fetch-only row in TestContributeMarkersTaskNoAutoProvider fails without a7aa296's fix.
  • The internal/markers unit tests exercise code this PR adds, so they don't build on the base.

Focused Go tests for internal/markers, internal/taskmanager/tasks, internal/api/handlers, internal/apiv2 and cmd/silo, the admin-settings web tests, Prettier, and make lint-changed all pass. Nothing was verified live, because no marker plugin sets supports_contribution: false yet.

Left for maintainers

  • Plugin SDK documentation. supports_contribution joins default_fetch_priority and required_external_ids as an undocumented capability metadata key. A follow-up in silo-plugin-sdk should document all three so plugin authors can find them.
  • Multi-replica timing (not introduced here). An API replica applies a plugin's capability change only when it next refreshes its marker providers. Until then it can still treat an opted-out plugin as a submitter. Every capability metadata change has the same lag, so this PR doesn't cause it. It has been traced in source but not reproduced.

Validated features

No passed validation case is reached. The PR only changes behavior for a plugin that opts out, and none does yet. #1148 C2 hasn't been run, so the Validation tasks: line is now none.

Other checks

  • User manual: unaffected, since nothing changes for existing plugins.
  • Apple/Android: no client API change. is_submitter already existed.
  • jellycompat: not involved.

Cross-provider review

Codex (gpt-6.1-sol) reviewed 8ddb552 independently. It confirmed the share-task finding, and it raised the multi-replica timing noted above.

Fit: 8/10 · Readiness: 9/10 — conditional (assuming CI is green)

  • Fit: this keeps the admin screen honest for fetch-only marker plugins and uses the plugin boundary that AGENTS.md sets for marker providers. It adds a new plugin-contract key that isn't documented yet.
  • Readiness: the fix is small and covered by tests that fail without it. No substantive concern remains in the code.

@silo-kody

silo-kody Bot commented Oct 21, 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 ❌

@macroscopeapp

macroscopeapp Bot commented Oct 21, 2026

Copy link
Copy Markdown

The latest MarkerProviderTiles.tsx change makes both sharing toggles appear off for a non-submitter even when saved flags are on, changing the Admin → Providers screen. The Evidence section explains that no plugin opts out yet, but does not show this newly changed state. When it can be reproduced, add before-and-after screenshots of the same tile and data at desktop and phone widths, and identify the surface and build or commit.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Quick104
Quick104 merged commit ca96ca6 into Silo-Server:main Oct 21, 2026
23 of 24 checks passed
rangoDJ added a commit to rangoDJ/silo-server that referenced this pull request Oct 24, 2026
contribute.go: this branch imports regexp and main (Silo-Server#3000) imports math;
keep both.

Main (Silo-Server#1785, Silo-Server#2689) dropped the task's config argument: the providers that
contribute automatically now come from the runner's AutoContributors. This
branch's three tests set up a provider through the removed fakeAutoConfig;
they now set the fake runner's auto contributors instead and call the
three-argument constructor. What they check is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@blurbery
blurbery deleted the fix/marker-plugin-fetch-only branch November 6, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants