router-for-me/CLIProxyAPI · error

config_update_failed

config_update_failed

Error message

decode plugin config: %w

What it means

Error "decode plugin config: %w" thrown in router-for-me/CLIProxyAPI.

Source

Thrown at internal/api/handlers/management/plugin_store.go:484

		return strings.TrimSpace(version[1:])
	}
	return version
}

// enablePluginConfigLocked sets plugins.configs.<id>.enabled and store while
// preserving the rest of the plugin's raw configuration. Callers must hold h.mu.
func (h *Handler) enablePluginConfigLocked(id string, storeManifest pluginstore.Manifest) error {
	ensurePluginConfigMap(h.cfg)
	node := pluginConfigNode(h.cfg.Plugins.Configs[id])
	storeNode, errStoreNode := pluginStoreManifestYAMLNode(storeManifest)
	if errStoreNode != nil {
		return errStoreNode
	}
	setYAMLMappingValue(node, "enabled", boolYAMLNode(true))
	setYAMLMappingValue(node, "store", storeNode)
	updated, errConfig := pluginInstanceConfigFromNode(node)
	if errConfig != nil {
		return fmt.Errorf("decode plugin config: %w", errConfig)
	}
	h.cfg.Plugins.Configs[id] = updated
	return nil
}

func pluginStoreManifestYAMLNode(manifest pluginstore.Manifest) (*yaml.Node, error) {
	var node yaml.Node
	if errEncode := node.Encode(manifest); errEncode != nil {
		return nil, fmt.Errorf("encode store manifest: %w", errEncode)
	}
	return &node, nil
}

func (h *Handler) pluginStoreSnapshot() (bool, string, string, []string, []pluginstore.AuthConfig, map[string]config.PluginInstanceConfig, *pluginhost.Host) {
	if h == nil {
		return false, "plugins", "", nil, nil, map[string]config.PluginInstanceConfig{}, nil
	}
	h.mu.Lock()

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Verify the plugin configuration payload is valid JSON/YAML matching the plugin store schema.
  2. Check the wrapped error for the exact decode failure and fix the malformed field in the plugin config.

When it happens

Trigger: Thrown at internal/api/handlers/management/plugin_store.go:484 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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