paperclipai/paperclip · error · Error

Workspace commands JSON must be a JSON object.

Error message

Workspace commands JSON must be a JSON object.

What it means

Shape guard in buildWorkspacePatch: the workspace 'commands' field must serialize to a JSON object (record of command strings), but the parsed/entered value is an array, scalar, or malformed JSON. The patch build aborts so an invalid commands map is never sent to the workspace update API.

Source

Thrown at ui/src/pages/ExecutionWorkspaceDetail.tsx:319

  maybeAssign("cwd");
  maybeAssign("repoUrl");
  maybeAssign("baseRef");
  maybeAssign("branchName");
  maybeAssign("providerRef");

  const maybeAssignConfigText = (key: keyof Pick<WorkspaceFormState, "provisionCommand" | "runtimeProvisionCommand" | "teardownCommand" | "cleanupCommand">) => {
    if (initialState[key] === nextState[key]) return;
    configPatch[key] = normalizeText(nextState[key]);
  };

  maybeAssignConfigText("provisionCommand");
  maybeAssignConfigText("runtimeProvisionCommand");
  maybeAssignConfigText("teardownCommand");
  maybeAssignConfigText("cleanupCommand");

  if (initialState.inheritRuntime !== nextState.inheritRuntime || initialState.workspaceRuntime !== nextState.workspaceRuntime) {
    const parsed = parseWorkspaceRuntimeJson(nextState.workspaceRuntime);
    if (!parsed.ok) throw new Error(parsed.error);
    configPatch.workspaceRuntime = nextState.inheritRuntime ? null : parsed.value;
  }

  if (Object.keys(configPatch).length > 0) {
    patch.config = configPatch;
  }

  return patch;
}

function validateForm(form: WorkspaceFormState) {
  const repoUrl = normalizeText(form.repoUrl);
  if (repoUrl) {
    try {
      new URL(repoUrl);
    } catch {
      return "Repo URL must be a valid URL.";
    }

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Enter a valid JSON object (e.g. {"job": {"command": "..."}}) for the workspace commands configuration.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ui/src/pages/ExecutionWorkspaceDetail.tsx:313 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/4fe01fe8dbd835aa. Report an issue: GitHub.