multica-ai/multica · error · Error

Invalid desktop runtime config: expected a JSON object

Error message

Invalid desktop runtime config: expected a JSON object

What it means

Wrap thrown by execenv.Prepare when prepareQwenpawWorkspace fails for a 'qwenpaw'-provider task. The daemon materializes <envRoot>/qwenpaw-workspace and seeds it with the task's bound agent skills (params.Task.AgentSkills); a filesystem or skill-writing error in that step aborts Prepare entirely.

Source

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

      : deriveWsUrl(apiUrl),
    appUrl: env.appUrl
      ? normalizeHttpUrl(env.appUrl, "VITE_APP_URL")
      : deriveDevAppUrl(apiUrl),
  };
}

export function parseRuntimeConfig(raw: string): RuntimeConfig {
  let parsed: unknown;
  try {
    parsed = JSON.parse(raw);
  } catch (err) {
    throw new Error(
      `Invalid desktop runtime config JSON: ${err instanceof Error ? err.message : "parse failed"}`,
    );
  }

  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
    throw new Error("Invalid desktop runtime config: expected a JSON object");
  }

  const obj = parsed as Record<string, unknown>;
  if (obj.schemaVersion !== 1) {
    throw new Error("Unsupported desktop runtime config schemaVersion: expected 1");
  }

  const apiUrl = requiredString(obj.apiUrl, "apiUrl");
  const appUrl = optionalString(obj.appUrl, "appUrl");
  const wsUrl = optionalString(obj.wsUrl, "wsUrl");

  const normalizedApiUrl = normalizeHttpUrl(apiUrl, "apiUrl");
  return {
    schemaVersion: 1,
    apiUrl: normalizedApiUrl,
    wsUrl: wsUrl ? normalizeWsUrl(wsUrl, "wsUrl") : deriveWsUrl(normalizedApiUrl),
    appUrl: appUrl ? normalizeHttpUrl(appUrl, "appUrl") : deriveAppUrl(normalizedApiUrl),
  };

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Check the wrapped error for the underlying filesystem operation that failed, then verify the daemon user can create directories and files under the task's env-root.
  2. Free disk space or remount the env-root volume read-write.
  3. Inspect the bound agent skills for entries whose files cannot be written (invalid paths, symlink loops) and fix or unbind them.
  4. Re-run the task preparation once the environment issue is corrected.
Defensive patterns

Strategy: validation

Validate before calling

if params.Provider == "qwenpaw" {
    if err := checkWritable(envRoot); err != nil {
        return fmt.Errorf("env-root not writable before qwenpaw prepare: %w", err)
    }
}

Try / catch

env, err := execenv.Prepare(ctx, params)
if err != nil && strings.Contains(err.Error(), "prepare qwenpaw workspace") {
    // log wrapped fs error, verify env-root perms/space, then fail the task visibly
}

Prevention

When it happens

Trigger: Prepare is called with params.Provider == "qwenpaw" and prepareQwenpawWorkspace returns an error — e.g. the env-root is not writable, the disk is full, or writing skill files into the workspace fails.

Common situations: Daemon running as a user without write access to its env-root; env-root on a full or read-only volume; a skill payload (name/path) that cannot be materialized as files under the workspace dir.

Related errors


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