Skip to content

Add skip git repo check to review command#191

Open
PeterTianbuhan wants to merge 1 commit into
tuannvm:mainfrom
PeterTianbuhan:codex/review-skip-git-check
Open

Add skip git repo check to review command#191
PeterTianbuhan wants to merge 1 commit into
tuannvm:mainfrom
PeterTianbuhan:codex/review-skip-git-check

Conversation

@PeterTianbuhan

@PeterTianbuhan PeterTianbuhan commented May 31, 2026

Copy link
Copy Markdown

Summary

  • pass --skip-git-repo-check before the review subcommand
  • add regression coverage for the review command arguments

Why

The review tool is invoked by MCP orchestration from working directories that may not be trusted by Codex yet. Matching the existing codex exec path avoids trusted-directory failures for review calls.

Fixes #124.

Testing

  • git diff --check
  • node node_modules/typescript/bin/tsc
  • node node_modules/jest/bin/jest.js src/__tests__/working-directory.test.ts --runInBand
  • node node_modules/jest/bin/jest.js --runInBand

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced review command to skip git repository checks, improving handling of working directory configurations.

Copilot AI review requested due to automatic review settings May 31, 2026 09:29
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93e81d52-3cfd-4f61-b88e-bdc271ccb895

📥 Commits

Reviewing files that changed from the base of the PR and between a57acb6 and e345d93.

📒 Files selected for processing (2)
  • src/__tests__/working-directory.test.ts
  • src/tools/handlers.ts

Walkthrough

ReviewToolHandler now passes --skip-git-repo-check to the Codex CLI before the review subcommand, matching behavior elsewhere. A new test validates the flag is included when workingDirectory is omitted and cwd is undefined.

Changes

Skip Git Repo Check Flag

Layer / File(s) Summary
ReviewToolHandler skip-git-repo-check flag
src/tools/handlers.ts, src/__tests__/working-directory.test.ts
ReviewToolHandler appends --skip-git-repo-check before the review subcommand. Test verifies the flag is present and cwd is undefined when workingDirectory is omitted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • tuannvm/codex-mcp-server#100: Both PRs modify src/tools/handlers.ts's ReviewToolHandler command-argument construction by introducing/reshaping --skip-git-repo-check usage for the review flow.
  • tuannvm/codex-mcp-server#85: The main PR's adjustment to ReviewToolHandler command construction (ensuring --skip-git-repo-check is placed before the review subcommand and verifying cwd: undefined when workingDirectory is omitted) directly builds on the Codex CLI v0.75.0 review/flag-ordering work from PR #85.
  • tuannvm/codex-mcp-server#138: The main PR's ReviewToolHandler updates (adding --skip-git-repo-check and asserting executeCommand is called with cwd: undefined when workingDirectory is omitted) build directly on the retrieved PR's ReviewToolHandler changes to pass cwd into the spawned Codex process options.

Poem

🐰 A flag hops in, before the review command runs,
No git repo trust check to dodge the sun,
The handler now skips with grace and care,
MCP can review anywhere!
Tests ensure the path is clear,
Safe passage for the code held dear. 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding the --skip-git-repo-check flag to the review command.
Linked Issues check ✅ Passed The PR fully addresses issue #124 by adding --skip-git-repo-check to ReviewToolHandler and providing regression test coverage as required.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the linked issue; test additions are regression coverage for the implemented fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: PeterTianbuhan <130898955+PeterTianbuhan@users.noreply.github.com>
@PeterTianbuhan PeterTianbuhan force-pushed the codex/review-skip-git-check branch from ac463d4 to e345d93 Compare May 31, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review tool missing --skip-git-repo-check flag

1 participant