(args: Args)
| 354 | } |
| 355 | |
| 356 | function reviewCommand(args: Args): void { |
| 357 | const targetRepo = argString(args, "target_repo", DEFAULT_TARGET_REPO); |
| 358 | const targetDir = resolve( |
| 359 | argString(args, "target_dir", repositoryProfileFor(targetRepo).checkoutDir), |
| 360 | ); |
| 361 | const sha = assertSha(argString(args, "commit_sha", "")); |
| 362 | const metadata = commitMetadata(targetDir, targetRepo, sha); |
| 363 | const baseSha = assertSha(argString(args, "base_sha", metadata.parents[0] ?? ""), "base sha"); |
| 364 | const reportDir = resolve(argString(args, "report_dir", "records")); |
| 365 | const artifactMode = argBool(args, "artifact_mode"); |
| 366 | const outputPath = artifactMode |
| 367 | ? join(reportDir, artifactReportRelativePath(targetRepo, sha)) |
| 368 | : resolve(commitReportRelativePath(targetRepo, sha)); |
| 369 | const additionalPrompt = argString( |
| 370 | args, |
| 371 | "additional_prompt", |
| 372 | process.env.COMMIT_SWEEPER_ADDITIONAL_PROMPT ?? "", |
| 373 | ); |
| 374 | const markdown = ensureCommitReportTimestamps( |
| 375 | runCodex({ |
| 376 | targetDir, |
| 377 | targetRepo, |
| 378 | sha, |
| 379 | baseSha, |
| 380 | metadata, |
| 381 | model: argString(args, "codex_model", DEFAULT_CODEX_MODEL), |
| 382 | reasoningEffort: argString(args, "codex_reasoning_effort", DEFAULT_REASONING_EFFORT), |
| 383 | sandboxMode: argString(args, "codex_sandbox", "danger-full-access"), |
| 384 | serviceTier: argString(args, "codex_service_tier", DEFAULT_SERVICE_TIER), |
| 385 | timeoutMs: argNumber(args, "codex_timeout_ms", 1_800_000), |
| 386 | workDir: resolve(argString(args, "work_dir", join(reportDir, ".codex"))), |
| 387 | additionalPrompt, |
| 388 | }), |
| 389 | metadata, |
| 390 | ); |
| 391 | ensureDir(dirname(outputPath)); |
| 392 | writeFileSync(outputPath, markdown.endsWith("\n") ? markdown : `${markdown}\n`, "utf8"); |
| 393 | console.log(outputPath); |
| 394 | } |
| 395 | |
| 396 | // GitHub credential env vars scrubbed before the offline local-review engine runs. |
| 397 | // Covers both gh enterprise aliases (GH_ENTERPRISE_TOKEN and GITHUB_ENTERPRISE_TOKEN), |
no test coverage detected