Skip to content

fix: include git history guard prompt when the bash tool is active - #172

Draft
samsja wants to merge 1 commit into
mainfrom
fix/prompt-git-block
Draft

fix: include git history guard prompt when the bash tool is active#172
samsja wants to merge 1 commit into
mainfrom
fix/prompt-git-block

Conversation

@samsja

@samsja samsja commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

The bash tool enforces the git-log history guard (find_blocked_command → refusal), but SHELL_TOOL_NAMES only counted ipython as a shell tool for prompt purposes. A bash-tool agent without ipython therefore got Git history option '--all' is not allowed refusals without GIT_HISTORY_GUARD_PROMPT ever telling it the restriction exists.

One-word fix: add bash to SHELL_TOOL_NAMES so the guard prompt is included whenever any guarded shell tool is active (still omitted when allow_git=true or no shell tool is enabled). Extended the existing prompt test to cover the bash case.

uv run pytest tests/ — 164 passed.

🤖 Generated with Claude Code

The bash tool enforces the git-log history guard but only ipython
counted as a shell tool for prompt purposes, so bash-only agents got
refusals they were never warned about.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant