router-for-me/CLIProxyAPI · error

unsupported install type %q

Error message

unsupported install type %q

What it means

Returned by ManifestFromPlugin (manifest.go:58-59) when the plugin's Install.Type is neither "direct" nor "github-release" after PluginInstallType normalizes it (lowercased, trimmed). It is a forward-compatibility guard: manifests cannot be generated for install types this build of the pluginstore does not know how to resolve.

Source

Thrown at internal/pluginstore/manifest.go:59

func ManifestFromPlugin(source Source, plugin Plugin) (Manifest, error) {
	if errValidate := ValidatePlugin(plugin); errValidate != nil {
		return Manifest{}, errValidate
	}
	switch PluginInstallType(plugin) {
	case InstallTypeDirect:
		manifest := manifestFromPlugin(source, plugin, Manifest{
			SchemaVersion: SchemaVersionV2,
			Version:       strings.TrimSpace(plugin.Version),
			Install:       NormalizeInstallPlan(plugin.Install),
		})
		if errValidate := manifest.Validate(); errValidate != nil {
			return Manifest{}, errValidate
		}
		return manifest, nil
	case InstallTypeGitHubRelease:
		return Manifest{}, fmt.Errorf("github-release manifest requires a resolved release")
	default:
		return Manifest{}, fmt.Errorf("unsupported install type %q", plugin.Install.Type)
	}
}

func manifestFromPlugin(source Source, plugin Plugin, base Manifest) Manifest {
	base.ID = strings.TrimSpace(plugin.ID)
	base.Name = strings.TrimSpace(plugin.Name)
	base.Description = strings.TrimSpace(plugin.Description)
	base.Author = strings.TrimSpace(plugin.Author)
	base.Logo = strings.TrimSpace(plugin.Logo)
	base.Homepage = strings.TrimSpace(plugin.Homepage)
	base.License = strings.TrimSpace(plugin.License)
	base.Tags = append([]string(nil), plugin.Tags...)
	base.SourceID = strings.TrimSpace(source.ID)
	base.SourceName = strings.TrimSpace(source.Name)
	base.SourceURL = strings.TrimSpace(source.URL)
	return base
}

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Check PluginInstallType(plugin) against the supported values before calling, and log the raw type for diagnosis
  2. Fix the registry entry's install.type to 'direct' or 'github-release'
  3. Upgrade (or align) the CLIProxyAPI version so its pluginstore understands the registry's install types

Example fix

// before
m, err := pluginstore.ManifestFromPlugin(src, plugin)
// after
t := pluginstore.PluginInstallType(plugin)
if t != pluginstore.InstallTypeDirect && t != pluginstore.InstallTypeGitHubRelease {
    return fmt.Errorf("cannot build manifest for install type %q", t)
}
m, err := pluginstore.ManifestFromPlugin(src, plugin)
Defensive patterns

Strategy: type-guard

Type guard

func supportedInstallType(p pluginstore.Plugin) bool {
    switch pluginstore.PluginInstallType(p) {
    case pluginstore.InstallTypeDirect, pluginstore.InstallTypeGitHubRelease:
        return true
    }
    return false
}

Prevention

When it happens

Trigger: Calling ManifestFromPlugin with plugin.Install.Type set to a typo ("Direct " with casing is fine since it lowercases, but "dircet" or "gitlab-release" is not), or a newer registry introducing a new install type consumed by an older binary.

Common situations: Registry schema drift after an upgrade (new install type added server-side); typos in hand-written registry YAML; custom forks adding install types without updating local enum handling.

Related errors


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/19f62b75ce13c7cd. Report an issue: GitHub.