fix(guardrails): the foreground-wait guard refuses a Monitor tool call
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 64/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- Shell
- Étoiles
- 22
- Forks
- 2
- Merge moyen
- 2 h
- PR mergées (30 j)
- 960
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de melodic-software/claude-code-plugins
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
melodic-software/claude-code-plugins#19225 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
melodic-software/claude-code-plugins#17779 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
recurring
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
melodic-software/claude-code-plugins#19274 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
melodic-software/claude-code-plugins#19270 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 53/100
melodic-software/claude-code-plugins#19269 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de melodic-software/claude-code-plugins
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
nais/attest-sign#139 ·
Les mainteneurs répondent en général sous 1 jour
-
check_for_release: the /opt/*_version.txt migration gives the app's version to any componentOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
community-scripts/core#303 ·
Les mainteneurs répondent en général sous 1 jour
-
severity: low
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
luainkernel/lunatik#2727 ·
Les mainteneurs répondent en général sous 1 jour
-
[quality] release publish.mjs integrity guards have no unit testPeut-être pris @robarnold l’a pris aujourd’hui. Ouverteagent/quality stage/040-covered-by-pr testing
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
marinatedconcrete/config#1155 ·
Les mainteneurs répondent en général sous 1 jour
-
bug report-to-upstream
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
flatpark/flatpark#1585 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour