Skip to content

fix(metadata): call enrichment-only plugin providers by declared lookup IDs - #1428

Merged
Quick104 merged 1 commit into
mainfrom
fix/metadata-lookup-provider-ids
Sep 25, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/metadata-lookup-provider-ids

Conversation

@Quick104

@Quick104 Quick104 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Silo never calls the MDBList metadata plugin, so the advisory age added in #1417, and MDBList's ratings, stay empty on every library.

PluginProvider.GetMetadata returns early unless the item already carries a provider ID keyed by the plugin's own capability ID (mdblist). An enrichment-only provider never assigns such an ID: it looks titles up by the IMDb or TMDB ID a primary provider resolved. So the host skips it on every refresh. The existing advisory test passed only because it keyed the request on mdblist, which a real item never has.

Solution

A metadata capability can now declare lookup_provider_ids in its manifest metadata: a list of provider-ID keys it can look an item up by. Silo calls GetMetadata when the item carries the provider's own ID, as before, or a non-empty value for any declared key. In the second case ProviderId is empty and the plugin reads the IDs it needs from ProviderIds.

  • The key is read from capability metadata at the top level or inside the SDK's metadata envelope, the same way default_priority and default_enabled are. Both chain paths load it: explicit library chains and the chain-less fallback. The explicit path now reads display name and metadata in one query instead of the display name alone.
  • Only GetMetadata opens up. Images, seasons and episodes address the provider's own catalog and stay gated on its own ID.
  • No proto or SDK change.

The key is new rather than a reuse of required_external_ids. The markers capability already reads that name as "all of these are required", while a lookup provider needs "any one of these". Nothing in the metadata chain ever read required_external_ids.

MDBList v0.2.0 is released and in the plugin catalog. It declares "lookup_provider_ids": ["imdb", "tmdb"] and drops required_external_ids. Either side can upgrade first: an older server ignores the key, and a server with this change behaves as before for a plugin that does not declare it.

Validation

  • New unit tests cover the gate: the provider's own ID, a declared key, no key, a declared key with an empty value, and GetImages staying gated. There are also parser cases for top-level, nested and malformed metadata.
  • The advisory test now uses realistic {imdb, tmdb} IDs and asserts the plugin is called.
  • A DB-backed test resolves both chain paths from a capability row that declares lookup keys.
  • Full pre-PR gate from CONTRIBUTING.md.

Not validated: a live refresh against the real MDBList API.

Risk

The plugin now runs on every movie and series metadata refresh, spending one request per title against MDBList's 1000/day free tier. When the quota runs out it returns nothing, and the refresh is unaffected. A refresh that gets nothing from it never clears an advisory age already stored.

It only sees IMDb or TMDB IDs if it runs after the primary provider. Seeded priorities do that (MDBList 8, TMDB 2/3, TVDB 2, metadb 1). A custom library chain has to keep that order.

Related issue: N/A
Validation tasks: reaches #1250 C2 (metadata through the provider chain); providers without lookup_provider_ids behave as before

AI disclosure

Written by Claude Opus 5.5 (model identifier claude-opus-5-5[1m]) running in Claude Code as the agent harness, driven interactively by the maintainer. Claude Code subagents on the same model were used for code search and planning. No other AI tooling was used. The maintainer chose the new manifest key over reusing required_external_ids and reviewed the approach.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Metadata lookups can now use provider IDs declared by a capability, including IMDb and TMDB IDs, when the item lacks the plugin’s own provider ID.
    • Lookup IDs are normalized before use; the plugin continues to receive the full set of available provider IDs.
  • Bug Fixes

    • Metadata requests are skipped when neither the plugin’s own ID nor any declared lookup ID is available. An alternate lookup ID alone does not trigger image requests.

…up IDs

A metadata plugin provider only ran when the item carried an ID of the
provider's own. The MDBList plugin never identifies titles, so no item
ever had an "mdblist" ID and Silo never called it: the advisory age from
#1417 and MDBList's ratings stayed empty on every library.

A capability can now declare lookup_provider_ids in its manifest
metadata, a list of provider-ID keys it can look an item up by. Silo
calls GetMetadata when the item carries any one of them, with an empty
ProviderId. Images, seasons and episodes stay gated on the provider's
own ID, since those address the provider's own catalog.

The key is new rather than a reuse of required_external_ids, which the
markers capability reads as "all of these are required".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@greptile-apps greptile-apps 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.

Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T00:55:44.115018Z 16428b2 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 859c1723-2e44-4f3b-8c1c-45913d371f42

📥 Commits

Reviewing files that changed from the base of the PR and between c972b54 and 16428b2.

📒 Files selected for processing (6)
  • internal/metadata/advisory_age_test.go
  • internal/metadata/chain.go
  • internal/metadata/chain_builtin_db_test.go
  • internal/metadata/chain_test.go
  • internal/metadata/plugin_provider.go
  • internal/metadata/plugin_provider_test.go

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change reads lookup_provider_ids from capability metadata, passes the normalized IDs through chain resolution, and allows PluginProvider.GetMetadata to proceed when an item has a matching declared ID even if its own provider ID is empty.

Changes

Plugin metadata lookup IDs

Layer / File(s) Summary
Parse capability lookup metadata
internal/metadata/chain.go, internal/metadata/chain_test.go
Capability metadata parsing extracts lookup provider IDs from the top-level field or nested metadata object. It trims, lowercases, and deduplicates values. The shared metadata-field lookup also handles default_enabled and default_priority.
Load and pass lookup IDs
internal/metadata/chain.go, internal/metadata/chain_builtin_db_test.go
Capability listing and chain resolution load lookup IDs and pass them to PluginProvider. Tests cover propagation in chain-less fallback and explicit-chain resolution.
Gate plugin metadata requests by provider IDs
internal/metadata/plugin_provider.go, internal/metadata/plugin_provider_test.go, internal/metadata/advisory_age_test.go
PluginProvider.GetMetadata proceeds when the item has its own provider ID or a non-empty value for a declared lookup ID. Tests cover request arguments, missing IDs, and the separate image-request behavior. The advisory-age test uses IMDb and TMDB IDs without an MDBList ID.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CapabilityMetadata
  participant ChainResolver
  participant PluginProvider
  participant PluginClient
  CapabilityMetadata->>ChainResolver: provide lookup_provider_ids
  ChainResolver->>PluginProvider: construct provider with lookup IDs
  PluginProvider->>PluginClient: request metadata when own or declared ID is present
Loading

Merge Risk: ⚪ Minimal · up to 16428

The change appears mergeable after normal checks. A live MDBList refresh remains unvalidated, but that alone does not establish a defect.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.19% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling metadata enrichment plugins to be called by their declared lookup provider IDs.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@Quick104
Quick104 merged commit 7038ccb into main Sep 25, 2026
11 checks passed
@Quick104
Quick104 deleted the fix/metadata-lookup-provider-ids branch September 25, 2026 01:47
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.

1 participant