paperclipai/paperclip · error · Error

Select a company to test environments

Error message

Select a company to test environments

What it means

Guard in draftEnvironmentProbeMutation: probing a draft environment's connectivity needs the company scope to route the probe request, but selectedCompanyId is falsy, so the mutation throws before issuing the probe.

Source

Thrown at ui/src/pages/CompanyEnvironments.tsx:1522

        ...current,
        [environmentId]: {
          ok: false,
          driver: failedEnvironment?.driver ?? "local",
          summary: error instanceof Error ? error.message : "Environment probe failed.",
          details: null,
        },
      }));
      pushToast({
        title: "Environment probe failed",
        body: error instanceof Error ? error.message : "Environment probe failed.",
        tone: "error",
      });
    },
  });

  const draftEnvironmentProbeMutation = useMutation({
    mutationFn: async (form: EnvironmentFormState) => {
      if (!selectedCompanyId) throw new Error("Select a company to test environments");
      const body = buildEnvironmentPayload(form);
      return await environmentsApi.probeConfig(selectedCompanyId, body);
    },
    onSuccess: (probe) => {
      pushToast({
        title: probe.ok ? "Draft probe passed" : "Draft probe failed",
        body: probe.summary,
        tone: probe.ok ? "success" : "error",
      });
    },
    onError: (error) => {
      pushToast({
        title: "Draft probe failed",
        body: error instanceof Error ? error.message : "Environment probe failed.",
        tone: "error",
      });
    },
  });

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Select a company from the company picker before testing environments.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ui/src/pages/CompanyEnvironments.tsx:1494 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/1c2b40b0d08a18c9. Report an issue: GitHub.