fix(guardrails): the foreground-wait guard refuses a Monitor tool call
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
Hướng nghiên cứu
Start by logging the JSON that arrives on stdin in plugins/guardrails/hooks/block-foreground-wait.sh and triggering a Monitor call, to see which tool_name and fields it carries. Compare that with the early exit at lines 65-66 and the Bash|PowerShell matcher in the plugin's hooks.json, which should mean the hook never fires for Monitor at all. Fix the tool-name handling and add a Monitor case to plugins/guardrails/hooks/block-foreground-wait.test.sh; done when that test passes and a real Monitor call is no longer refused.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Steps to reproduce
- In an interactive Claude Code session with the
guardrailsplugin enabled, call the Monitor tool with a command holding anuntilloop, for exampleuntil [ -s <file> ]; do sleep 60; done; echo done.
Expected behavior
The call runs. Monitor is the tool the guard's own message recommends: "Run the command with run_in_background set to true, or watch it with the Monitor tool".
Actual behavior
The call is refused with PreToolUse:Monitor hook error: [command hook 10]: BLOCKED: This until loop waits in the foreground. Run the command with run_in_background set to true, or watch it with the Monitor tool, and read the result when it finishes. (observed 2026-11-23 in the Software Factory Part Two session).
Severity
Low.
Severity justification
The refusal sends a session to the tool it then refuses; a session can wait for subagent notifications instead, so nothing is lost, but a correct wait is turned away.
Suggested fix location
plugins/guardrails/hooks/block-foreground-wait.sh:65-66exits unless the tool name isBash, andhooks.jsonregisters the hook only underBash|PowerShell, so how the Monitor call reached it is not known: the hook payload was not visible. First step: capture the PreToolUse payload of a Monitor call and see whichtool_nameand fields it carries.plugins/guardrails/hooks/block-foreground-wait.test.shhas no Monitor case; add one.
Environment
Claude Code with guardrails 4.2.0 (installed cache), WSL2 Ubuntu.
session: Software Factory Part Two (workshop 08 alignment pass, ledger Q2113).
- Ngôn ngữ chính
- Shell
- Star
- 22
- Fork
- 2
- Merge trung bình
- 2 giờ
- Pull request đã merge (30 ngày)
- 960
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của melodic-software/claude-code-plugins
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
melodic-software/claude-code-plugins#19225 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
melodic-software/claude-code-plugins#17779 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
recurring
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
melodic-software/claude-code-plugins#19274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
melodic-software/claude-code-plugins#19270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 53/100
melodic-software/claude-code-plugins#19269 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của melodic-software/claude-code-plugins
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nais/attest-sign#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
check_for_release: the /opt/*_version.txt migration gives the app's version to any componentĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
community-scripts/core#303 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
severity: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
luainkernel/lunatik#2727 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[quality] release publish.mjs integrity guards have no unit testCó thể đã có người làm @robarnold đã nhận hôm nay. Đang mởagent/quality stage/040-covered-by-pr testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
marinatedconcrete/config#1155 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug report-to-upstream
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
flatpark/flatpark#1585 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày