router-for-me/CLIProxyAPI · error

cliproxy_plugin_init returned %d

Error message

cliproxy_plugin_init returned %d

What it means

Error "cliproxy_plugin_init returned %d" thrown in router-for-me/CLIProxyAPI.

Source

Thrown at internal/pluginhost/loader_unix.go:152

	if hostCtx == nil {
		C.free(unsafe.Pointer(hostAPI))
		C.cliproxy_dlclose(handle)
		return nil, fmt.Errorf("allocate host context")
	}
	id := hostCallbackID.Add(1)
	*(*C.uintptr_t)(hostCtx) = C.uintptr_t(id)
	hostCallbackEntries.Store(id, dynamicHostCallbackEntry{host: host, pluginID: file.ID})
	C.cliproxy_set_host_api(hostAPI, C.uint32_t(pluginHostABIVersion), hostCtx)

	client := &dynamicLibraryClient{
		handle:  handle,
		hostAPI: hostAPI,
		hostCtx: hostCtx,
	}
	rc := C.cliproxy_call_init(initSymbol, hostAPI, &client.api)
	if rc != 0 {
		client.Shutdown()
		return nil, fmt.Errorf("cliproxy_plugin_init returned %d", int(rc))
	}
	if uint32(client.api.abi_version) != pluginHostABIVersion {
		client.Shutdown()
		return nil, fmt.Errorf("plugin ABI version %d is not supported", uint32(client.api.abi_version))
	}
	if client.api.call == nil || client.api.free_buffer == nil {
		client.Shutdown()
		return nil, fmt.Errorf("plugin function table is incomplete")
	}
	return client, nil
}

func (c *dynamicLibraryClient) Call(ctx context.Context, method string, request []byte) ([]byte, error) {
	if c == nil || c.api.call == nil {
		return nil, fmt.Errorf("plugin client is closed")
	}
	if ctx != nil {
		select {

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Check the plugin's init return code meaning in its documentation.
  2. Update the plugin so cliproxy_plugin_init succeeds with this host version.

When it happens

Trigger: Thrown at internal/pluginhost/loader_unix.go:152 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/109c66bfda5d4d7a. Report an issue: GitHub.