sipeed/picoclaw · error

invalid gateway host

Error message

invalid gateway host: %w

What it means

Wraps a failure from resolveGatewayHostFromEnv during LoadConfig: the configured or env-resolved gateway bind host is not a valid address. LoadConfig returns this so startup fails fast instead of opening listeners on an unusable host.

Solutions

  1. Check the gateway.host value in config.json and any host environment override for typos or invalid values
  2. Use a valid bind address such as 127.0.0.1, 0.0.0.0, or a resolvable hostname
  3. Remove an empty or malformed host env override so the default is used
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/config/config.go:1531 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/5edad9499132c680. Report an issue: GitHub.

Appendix: source

Thrown at pkg/config/config.go:1531

	applyLegacyBindingsMigration(data, cfg)

	gatewayHostBeforeEnv := cfg.Gateway.Host

	if err = env.Parse(cfg); err != nil {
		return nil, err
	}
	applySkillsRegistryEnvCompat(cfg)

	if err = InitChannelList(cfg.Channels); err != nil {
		return nil, err
	}
	if err = cfg.ValidateTurnProfile(); err != nil {
		return nil, err
	}
	cfg.Gateway.Host, err = resolveGatewayHostFromEnv(gatewayHostBeforeEnv)
	if err != nil {
		return nil, fmt.Errorf("invalid gateway host: %w", err)
	}

	// Expand multi-key configs into separate entries for key-level failover
	cfg.ModelList = expandMultiKeyModels(cfg.ModelList)

	// Validate model_list for uniqueness and required fields
	if err = cfg.ValidateModelList(); err != nil {
		return nil, err
	}

	// Ensure Workspace has a default if not set
	if cfg.Agents.Defaults.Workspace == "" {
		homePath := GetHome()
		cfg.Agents.Defaults.Workspace = filepath.Join(homePath, pkg.WorkspaceName)
	}

	cfg.Session.ApplyDmScope()
	cfg.Session.DeriveDmScope()

View on GitHub (pinned to 49183d7e8d)