diff --git a/scripts/gadget.py b/scripts/gadget.py index 3f1522b..4a6991a 100644 --- a/scripts/gadget.py +++ b/scripts/gadget.py @@ -33,6 +33,13 @@ def build_system_prompt(tools_definition): f"Your workspace directory is: {os.getcwd()}. " "All file operations are relative to this directory.", "", + "⚠️ GIT POLICY — IMPORTANT:", + "- NEVER run 'git add' or 'git commit' automatically after making changes.", + "- After editing/creating files, always ASK the user first before committing.", + "- Only run git commands when the user explicitly asks you to commit.", + "- You may run 'git status', 'git diff', 'git log' freely to inspect state.", + "- When user asks to commit: show them the changes first, then wait for confirmation.", + "", "RAG capabilities (knowledge retrieval):", "- list_collections → see available collections & doc counts.", "- create_collection → create a new collection for a new topic.", diff --git a/tools/coder.py b/tools/coder.py index 4e4929b..9f633ae 100644 --- a/tools/coder.py +++ b/tools/coder.py @@ -146,7 +146,10 @@ schema_git_operation = { "type": "function", "function": { "name": "git_operation", - "description": "Run a git command. Pass the git arguments as a list (e.g., ['status', '--short'] for 'git status --short').", + "description": "Run a git command. Pass the git arguments as a list (e.g., ['status', '--short'] for 'git status --short'). " + "POLICY: Never run 'git add' or 'git commit' without explicit user permission. " + "Safe to run without asking: git status, git diff, git log. " + "Always ask first before committing.", "parameters": { "type": "object", "properties": {