yamadashy/repomix · info · OperationCancelledError

Remote config not trusted

Error message

Remote config not trusted

What it means

This OperationCancelledError is thrown when the user declines to trust the remote repository's config: they pick 'No, do not run' or cancel the clack select (Ctrl-C/Esc). Repomix prints 'Aborted: remote config was not trusted.' and aborts the remote run rather than defaulting to trust — the menu's initialValue is 'no' so even a stray Enter aborts. It is a deliberate, expected cancellation, not a malfunction.

Source

Thrown at src/cli/prompts/remoteConfigTrustPrompt.ts:304

      label: "Yes, and don't ask again for this repository",
      hint: 'until this repo changes its config, or your OS clears its temp dir',
    },
    { value: 'no', label: 'No, do not run' },
  ];

  const clack = await deps.loadClack();
  const choice = await clack.select({
    // Restate the risk and the source here: this line renders last and stays on
    // screen with the options, so it survives a config that scrolled the banner away.
    message: `Trust and run this config from ${sanitizeForDisplay(redactUrl(repoUrl))}? It can run arbitrary commands on your machine.`,
    options: trustOptions,
    // Default to the safe choice so a stray Enter never grants trust.
    initialValue: 'no' satisfies RemoteTrustChoice,
  });

  if (clack.isCancel(choice) || choice === 'no') {
    clack.cancel('Aborted: remote config was not trusted.');
    throw new OperationCancelledError('Remote config not trusted');
  }

  if (choice === 'always') {
    await deps.markRemoteConfigTrusted(repoUrl, configDigest);
  }
  // 'once' or 'always' → proceed
};

View on GitHub (pinned to f465ad9093)

Solutions

  1. If the config is legitimate, re-run and choose 'Yes, once' or "Yes, and don't ask again for this repository".
  2. For automation, use the trust env/flag (REPOMIX_REMOTE_TRUST_CONFIG / --remote-trust-config) after reviewing the config once, so the prompt is skipped.
  3. If declining was accidental, just re-run the command; nothing is persisted on decline.
  4. To avoid loading the remote config at all, pass `--config` pointing at a local file.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await confirmRemoteConfigTrust(options);
} catch (e) {
  if (e instanceof OperationCancelledError && e.message === 'Remote config not trusted') {
    console.error('User declined the remote config; aborting cleanly.');
    return; // expected cancellation, not a bug
  }
  throw e;
}

Prevention

When it happens

Trigger: During `repomix --remote <url>` with a trust-requiring config in the cloned repo: the user answers the 'Trust and run this config from <repo>?' prompt with 'No, do not run', presses Ctrl-C/Esc (clack.isCancel), or accepts the 'no' initial value with Enter.

Common situations: A developer reviews the shipped config, sees suspicious input.processors or executable (js/ts) config code, and declines; accidental Ctrl-C during the prompt; scripted runs where stdin sends an unexpected keystroke cancelling the select.

Related errors


AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29). Data as JSON: /api/errors/8f6badd6394290c6. Report an issue: GitHub.