multica-ai/multica · error · Error

Invalid desktop runtime config: ${field} must use http or ht

Error message

Invalid desktop runtime config: ${field} must use http or https

What it means

Validation error from hermesProfileDir: a profile name that is empty after TrimSpace. It reproduces the Hermes CLI's normalize_profile_name + validate_profile_name contract — Hermes itself sys.exit(1)s on an empty name, so the daemon rejects it before any filesystem work. The returned home/mustExist values are zero.

Source

Thrown at apps/desktop/src/shared/runtime-config.ts:150

}

function optionalString(value: unknown, field: string): string | undefined {
  if (value === undefined) return undefined;
  if (typeof value !== "string" || value.trim().length === 0) {
    throw new Error(`Invalid desktop runtime config: ${field} must be a non-empty string when set`);
  }
  return value;
}

function normalizeHttpUrl(value: string, field: string): string {
  let url: URL;
  try {
    url = new URL(value.trim());
  } catch {
    throw new Error(`Invalid desktop runtime config: ${field} must be a valid URL`);
  }
  if (url.protocol !== "http:" && url.protocol !== "https:") {
    throw new Error(`Invalid desktop runtime config: ${field} must use http or https`);
  }
  url.search = "";
  url.hash = "";
  return trimTrailingSlash(url.toString());
}

function normalizeWsUrl(value: string, field: string): string {
  let url: URL;
  try {
    url = new URL(value.trim());
  } catch {
    throw new Error(`Invalid desktop runtime config: ${field} must be a valid URL`);
  }
  if (url.protocol !== "ws:" && url.protocol !== "wss:") {
    throw new Error(`Invalid desktop runtime config: ${field} must use ws or wss`);
  }
  url.search = "";
  url.hash = "";

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Set a real profile name (or "default") in the agent's hermes configuration.
  2. Add form/env validation rejecting empty or whitespace-only profile names where they are entered.
  3. If the empty value comes from templating, fix the template default.

Example fix

// before
profile := strings.TrimSpace(os.Getenv("HERMES_PROFILE")) // "" when unset
home, mustExist, err := hermesProfileDir(root, profile) // err: name cannot be empty

// after
profile := strings.TrimSpace(os.Getenv("HERMES_PROFILE"))
if profile == "" {
    profile = "default"
}
home, mustExist, err := hermesProfileDir(root, profile)
Defensive patterns

Strategy: validation

Validate before calling

name := strings.TrimSpace(name)
if name == "" {
    return fmt.Errorf("profile name required")
}

Type guard

func isValidHermesProfileInput(name string) bool {
    return strings.TrimSpace(name) != ""
}

Try / catch

home, mustExist, err := hermesProfileDir(root, name)
if err != nil {
    if strings.Contains(err.Error(), "cannot be empty") {
        // fall back to "default" or reject at the form/API layer
    }
}

Prevention

When it happens

Trigger: hermesProfileDir is called with a name that is empty or whitespace-only (strings.TrimSpace(name) == "") — e.g. an agent's hermes profile config holds an empty string or only spaces, or a caller trims a variable to nothing before passing it.

Common situations: Agent created with HERMES_PROFILE unset/blank in config; a UI form allowing whitespace-only profile names; env var interpolation yielding an empty string; trimming done twice with the second trim producing "".

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/ad5aeabda0fb4d27. Report an issue: GitHub.