{"record":{"id":"8f6badd6394290c6","repo":"yamadashy/repomix","slug":"remote-config-not-trusted","errorCode":null,"errorMessage":"Remote config not trusted","messagePattern":"Remote config not trusted","errorType":"exception","errorClass":"OperationCancelledError","httpStatus":null,"severity":"info","filePath":"src/cli/prompts/remoteConfigTrustPrompt.ts","lineNumber":304,"sourceCode":"      label: \"Yes, and don't ask again for this repository\",\n      hint: 'until this repo changes its config, or your OS clears its temp dir',\n    },\n    { value: 'no', label: 'No, do not run' },\n  ];\n\n  const clack = await deps.loadClack();\n  const choice = await clack.select({\n    // Restate the risk and the source here: this line renders last and stays on\n    // screen with the options, so it survives a config that scrolled the banner away.\n    message: `Trust and run this config from ${sanitizeForDisplay(redactUrl(repoUrl))}? It can run arbitrary commands on your machine.`,\n    options: trustOptions,\n    // Default to the safe choice so a stray Enter never grants trust.\n    initialValue: 'no' satisfies RemoteTrustChoice,\n  });\n\n  if (clack.isCancel(choice) || choice === 'no') {\n    clack.cancel('Aborted: remote config was not trusted.');\n    throw new OperationCancelledError('Remote config not trusted');\n  }\n\n  if (choice === 'always') {\n    await deps.markRemoteConfigTrusted(repoUrl, configDigest);\n  }\n  // 'once' or 'always' → proceed\n};\n","sourceCodeStart":286,"sourceCodeEnd":312,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/cli/prompts/remoteConfigTrustPrompt.ts#L286-L312","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["If the config is legitimate, re-run and choose 'Yes, once' or \"Yes, and don't ask again for this repository\".","For automation, use the trust env/flag (REPOMIX_REMOTE_TRUST_CONFIG / --remote-trust-config) after reviewing the config once, so the prompt is skipped.","If declining was accidental, just re-run the command; nothing is persisted on decline.","To avoid loading the remote config at all, pass `--config` pointing at a local file."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await confirmRemoteConfigTrust(options);\n} catch (e) {\n  if (e instanceof OperationCancelledError && e.message === 'Remote config not trusted') {\n    console.error('User declined the remote config; aborting cleanly.');\n    return; // expected cancellation, not a bug\n  }\n  throw e;\n}","preventionTips":["Review the config before choosing 'always' trust; it can run arbitrary commands.","Avoid sending stray keystrokes/EOF to stdin of the CLI in scripts.","Use REPOMIX_REMOTE_TRUST_CONFIG / --remote-trust-config for non-interactive runs instead of scripting answers to the prompt.","Treat OperationCancelledError as normal control flow, not a crash."],"tags":["user-cancellation","remote-config","interactive-prompt","security"],"backgroundTag":"operation-cancelled-by-user","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}