@@ -13296,6 +13296,9 @@ var CodexProvider = class extends Provider {
1329613296 "--output-last-message",
1329713297 options.outputLastMessageFile
1329813298 ];
13299+ if (options.skipGitRepoCheck) {
13300+ args.splice(1, 0, "--skip-git-repo-check");
13301+ }
1329913302 if (options.disableTools) {
1330013303 args.push(
1330113304 "--disable",
@@ -13316,9 +13319,6 @@ var CodexProvider = class extends Provider {
1331613319 "plugins"
1331713320 );
1331813321 }
13319- if (options.skipGitRepoCheck) {
13320- args.push("--skip-git-repo-check");
13321- }
1332213322 if (options.outputSchemaFile) {
1332313323 args.push("--output-schema", options.outputSchemaFile);
1332413324 }
@@ -27768,6 +27768,8 @@ function sanitizeError(error2) {
2776827768var fs14 = __toESM(require("fs/promises"));
2776927769var os6 = __toESM(require("os"));
2777027770var path13 = __toESM(require("path"));
27771+ var import_child_process7 = require("child_process");
27772+ var import_util5 = require("util");
2777127773var INTENTS = [
2777227774 "question",
2777327775 "disagreement",
@@ -27780,6 +27782,7 @@ var SUGGESTED_ACTIONS = [
2778027782 "suggest_rr_skip",
2778127783 "ask_for_details"
2778227784];
27785+ var execFileAsync = (0, import_util5.promisify)(import_child_process7.execFile);
2778327786var CodexDiscussionResponder = class {
2778427787 constructor(model, timeoutMs) {
2778527788 this.model = model;
@@ -27792,6 +27795,7 @@ var CodexDiscussionResponder = class {
2779227795 });
2779327796 const cwd = await fs14.mkdtemp(path13.join(os6.tmpdir(), "review-router-chat-"));
2779427797 try {
27798+ await initializeEmptyGitRepository(cwd);
2779527799 const content = await provider.runStructuredPrompt(
2779627800 this.buildPrompt(context),
2779727801 this.buildSchema(),
@@ -27931,6 +27935,12 @@ function redactSecrets(value) {
2793127935function escapeAttr(value) {
2793227936 return value.replace(/&/g, "&").replace(/"/g, """);
2793327937}
27938+ async function initializeEmptyGitRepository(cwd) {
27939+ try {
27940+ await execFileAsync("git", ["init", "-q"], { cwd, timeout: 5e3 });
27941+ } catch {
27942+ }
27943+ }
2793427944
2793527945// src/main.ts
2793627946function syncEnvFromInputs() {
0 commit comments