langchain-ai/deepagents · error · MarketplaceError

GitHub marketplace source is missing repository metadata

Error message

GitHub marketplace source is missing repository metadata

What it means

When materializing a marketplace whose source_type is "github", the source object must be a RepositoryMarketplaceSource carrying repository metadata (owner/repo). If the parsed source claims to be a GitHub type but lacks that subclass, the library cannot know which repository to clone and raises this error.

Source

Thrown at libs/code/deepagents_code/plugins/marketplace.py:425

    Raises:
        MarketplaceError: If loading, cloning, downloading, or parsing fails.
    """
    if source.source_type == "directory":
        root = Path(source.value).expanduser().resolve()
        return load_marketplace(root), root
    if source.source_type == "file":
        path = Path(source.value).expanduser().resolve()
        return _load_marketplace_file(path), path
    if source.source_type == "url":
        path = _download_marketplace(source.value)
        marketplace = _load_marketplace_file(path)
        _reject_url_marketplace_with_local_plugins(marketplace, source.value)
        return marketplace, path
    if source.source_type == "github":
        if not isinstance(source, RepositoryMarketplaceSource):
            msg = "GitHub marketplace source is missing repository metadata"
            raise MarketplaceError(msg)
        root = _materialize_marketplace_repository(
            source, f"https://github.com/{source.value}.git"
        )
        return load_marketplace(root), root
    if source.source_type == "git":
        if not isinstance(source, RepositoryMarketplaceSource):
            msg = "Git marketplace source is missing repository metadata"
            raise MarketplaceError(msg)
        root = _materialize_marketplace_repository(source, source.value)
        return load_marketplace(root), root
    msg = f"Unsupported marketplace source type: {source.source_type}"
    raise MarketplaceError(msg)


def _reject_url_marketplace_with_local_plugins(
    marketplace: PluginMarketplace, url: str
) -> None:
    """Reject URL marketplaces whose plugins need a sibling filesystem tree.

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Construct the source as RepositoryMarketplaceSource with the owner/repo value (e.g. "org/repo")
  2. Fix the deserialization/parsing path so github sources produce RepositoryMarketplaceSource
  3. Check that the marketplace config file declares the required repository fields

Example fix

// before
source = MarketplaceSource(source_type="github", value="org/repo")
// after
source = RepositoryMarketplaceSource(source_type="github", value="org/repo")
Defensive patterns

Strategy: type-guard

Validate before calling

if source.source_type == "github" and not isinstance(source, RepositoryMarketplaceSource):
    raise ValueError("github source must be RepositoryMarketplaceSource")

Type guard

def is_repository_source(source: MarketplaceSource) -> bool:
    return isinstance(source, RepositoryMarketplaceSource)

Try / catch

try:
    marketplace, path = materialize_marketplace_source(source)
except MarketplaceError as exc:
    if "GitHub marketplace source is missing repository metadata" in str(exc):
        source = RepositoryMarketplaceSource(source_type="github", value=source.value)
        marketplace, path = materialize_marketplace_source(source)
    else:
        raise

Prevention

When it happens

Trigger: materialize_marketplace_source receives a source with source_type == "github" that is not an instance of RepositoryMarketplaceSource — typically constructed programmatically or deserialized from malformed config.

Common situations: Hand-built source objects missing the repository field; a deserializer instantiating the base marketplace-source class instead of RepositoryMarketplaceSource; a schema change between library versions.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/086469248f4577aa. Report an issue: GitHub.