paperclipai/paperclip · error · Error

No environment selected

Error message

No environment selected

What it means

Placeholder error recorded for the 'No environment selected' state in CompanyEnvironments.tsx. It fires when an environment-scoped action (secret or environment operation) is attempted while the environment selection is empty — a precondition sentinel, not a server response.

Source

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

  });
  const createSecret = useMutation({
    mutationFn: (input: { name: string; value: string }) => {
      if (!selectedCompanyId) throw new Error("Select a company to create secrets");
      return secretsApi.create(selectedCompanyId, input);
    },
    onSuccess: async () => {
      if (!selectedCompanyId) return;
      await queryClient.invalidateQueries({ queryKey: queryKeys.secrets.list(selectedCompanyId) });
    },
  });

  // Managed (platform-provisioned) environments accept exactly one tenant
  // edit: the env var map. The server's write floor rejects everything
  // else, so this mutation sends an envVars-only PATCH — the one body
  // shape the floor admits.
  const managedEnvironmentEnvVarsMutation = useMutation({
    mutationFn: async (envVars: EnvironmentFormState["envVars"]) => {
      if (!editingEnvironmentId) throw new Error("No environment selected");
      return await environmentsApi.update(editingEnvironmentId, { envVars }, selectedCompanyId);
    },
    onSuccess: async (environment) => {
      if (selectedCompanyId) {
        await queryClient.invalidateQueries({
          queryKey: queryKeys.environments.list(selectedCompanyId),
        });
      }
      initializedFormKeyRef.current = null;
      setEnvironmentForm(createEmptyEnvironmentForm());
      setEnvironmentFormBaselineKey(null);
      setEnvironmentVariablesDirty(false);
      navigate(ENVIRONMENTS_PATH, { replace: true });
      pushToast({
        title: "Environment variables updated",
        body: `${environment.name} will inject the updated variables into future runs.`,
        tone: "success",
      });

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Select an environment before performing this action.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ui/src/pages/CompanyEnvironments.tsx:1348 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/7105d56202777744. Report an issue: GitHub.