@Override
  public void execute(@NotNull ExecutionEnvironment environment) throws ExecutionException {
    var state = environment.getState();
    if (state != null) {
      ExecutionManager.getInstance(environment.getProject()).startRunProfile(environment, () -> {
        try {
          return executeWithLegacyWorkaround(environment, state);
        }
        catch (ExecutionException e) {
          throw new RuntimeException(e.getMessage(), e);
        }
      });
    }
  }
@Override
  public void execute(@NotNull ExecutionEnvironment environment)