LykosAI/StabilityMatrix · error · NotSupportedException

The package does not support extensions.

Error message

The package {PackagePair?.BasePackage} does not support extensions.

What it means

RefreshCore in PackageExtensionBrowserViewModel requires the package's BasePackage to expose an ExtensionManager. If PackagePair?.BasePackage.ExtensionManager is null, it throws NotSupportedException stating the package does not support extensions. This is a capability check: only packages whose implementation provides an extension manager can browse or install extensions.

Solutions

  1. Use this view only with packages that support extensions (BasePackage.ExtensionManager != null).
  2. Guard the caller with a capability check before opening the extension browser and disable the entry point otherwise.
  3. Verify PackagePair is fully initialized (BasePackage and InstalledPackage set) before refreshing.
  4. Update the package/base package definition to one that implements an ExtensionManager.

Example fix

// before
if (PackagePair?.BasePackage.ExtensionManager is not { } extensionManager)
    throw new NotSupportedException($"The package {PackagePair?.BasePackage} does not support extensions.");
// after
if (PackagePair?.BasePackage.ExtensionManager is not { } extensionManager)
{
    Logger.LogWarning("Package {Package} does not support extensions; skipping refresh", PackagePair?.BasePackage);
    return;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (viewModel.PackagePair?.BasePackage?.ExtensionManager is null) {
    // disable the extension browser entry point for this package
    return;
}

Type guard

bool SupportsExtensions(PackagePair? pair) => pair?.BasePackage?.ExtensionManager is not null;

Try / catch

try { await viewModel.Refresh(); }
catch (NotSupportedException ex) { Logger.LogWarning(ex, "Extensions unsupported"); Notify("This package does not support extensions."); }

Prevention

When it happens

Trigger: Opening the extension browser (Refresh/RefreshBackground -> RefreshCore) for a package whose type does not implement an ExtensionManager, or when PackagePair/BasePackage is null so the extension manager lookup fails.

Common situations: Browsing extensions for a backend package (e.g. ComfyUI vs a package without extension support) that lacks extension integration; a partially initialized PackagePair where BasePackage hasn't been set; a package version whose extension support was added later.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/c589c777e11b7b3e. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageExtensionBrowserViewModel.cs:788

        RefreshBackground();
    }

    public void RefreshBackground()
    {
        RefreshCore()
            .SafeFireAndForget(ex =>
            {
                notificationService.ShowPersistent("Failed to refresh extensions", ex.ToString());
            });
    }

    private async Task RefreshCore()
    {
        using var _ = CodeTimer.StartDebug();

        if (PackagePair?.BasePackage.ExtensionManager is not { } extensionManager)
            throw new NotSupportedException(
                $"The package {PackagePair?.BasePackage} does not support extensions."
            );

        var availableExtensions = (
            await extensionManager.GetManifestExtensionsAsync(
                extensionManager.GetManifests(PackagePair.InstalledPackage)
            )
        ).ToArray();

        var installedExtensions = (
            await extensionManager.GetInstalledExtensionsAsync(PackagePair.InstalledPackage)
        ).ToArray();

        // Synchronize
        SynchronizeExtensions(availableExtensions, installedExtensions);

        await Task.Run(() =>
        {

View on GitHub (pinned to af93d6ef57)