fix: allow Git write operations through bash tool - #181
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR updates shell guidance to allow selected Git operations, prohibit destructive Git commands, and restrict project source-file changes to edit/write tools. Tests validate the policy in full and minimal tool modes, and documentation reflects the same rules. ChangesShell guidance and validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis follow-up narrows Bash’s Git-write exception to five named routine operations while explicitly withholding authorization for destructive Git commands.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/server.ts | Replaces the blanket Git exception with an explicit allowlist and clearly excludes destructive commands, resolving the previous finding. |
| src/server.test.ts | Verifies the allowlist and destructive-command warning across full and minimal tool modes, command schemas, and initialization instructions. |
| docs/chatgpt-coding-workflow.md | Documents the same bounded Git-write policy exposed by the server. |
Reviews (2): Last reviewed commit: "fix: narrow Git write guidance" | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/chatgpt-coding-workflow.md`:
- Around line 206-210: Update the Git/source-write guidance in the documented
workflow to use a hard prohibition, matching the server instruction and Bash
descriptions. State that all shell commands that create or modify project source
files are prohibited outside explicitly allowed Git operations, and keep the
same comprehensive wording and examples across both policy surfaces, including
cp, mv, python -c, and other omitted writers.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 185213b0-e50a-463c-a7d4-16bfebc6332b
📒 Files selected for processing (3)
docs/chatgpt-coding-workflow.mdsrc/server.test.tssrc/server.ts
DevSpace's Bash tool can execute Git write operations, but the model-facing description frames Git usage as inspection-only and broadly forbids file modifications. MCP hosts can therefore reject
git add,git commit,git fetch,git pull, andgit pushbefore DevSpace receives a tool call.This change makes the existing capability explicit in the Bash descriptor, command schema, and server instructions while preserving the guidance against using shell redirection or generated scripts to edit project source files. The allowed Git writes are limited to
git add,git commit,git fetch,git pull, andgit push; destructive commands such asgit reset --hard,git clean,git checkout --, and branch deletion remain explicitly unauthorized. The user workflow documentation now reflects the same boundary.The MCP server regression test exercises both full and minimal tool modes through
listTools()and the initialization instructions, including negative assertions for destructive Git commands. The focused server test, full test suite, typecheck, production build, Windows doctor, andgit diff --checkall pass.Fixes #149
Summary by CodeRabbit
Documentation
Tests