fix(guardrails): the foreground-wait guard refuses a Monitor tool call
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Shell
- スター
- 22
- フォーク
- 2
- 平均マージ
- 2時間
- マージ済み PR(30日)
- 960
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
melodic-software/claude-code-plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
melodic-software/claude-code-plugins#19225 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
melodic-software/claude-code-plugins#17779 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
recurring
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
melodic-software/claude-code-plugins#19274 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
melodic-software/claude-code-plugins#19270 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 53/100
melodic-software/claude-code-plugins#19269 ·
メンテナーはふだん 1 日以内に返信
melodic-software/claude-code-plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nais/attest-sign#139 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
community-scripts/core#303 ·
メンテナーはふだん 1 日以内に返信
-
severity: low
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
luainkernel/lunatik#2727 ·
メンテナーはふだん 1 日以内に返信
-
[quality] release publish.mjs integrity guards have no unit test対応中かも @robarnold が今日担当しました。 オープンagent/quality stage/040-covered-by-pr testing
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
marinatedconcrete/config#1155 ·
メンテナーはふだん 1 日以内に返信
-
bug report-to-upstream
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
flatpark/flatpark#1585 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信