Skip to content

fix: advisory-mode Stop hook emits its finding instead of returning silently - #8

Merged
Nazim22 merged 1 commit into
mainfrom
dae/LL-7-advisory-stop-silence
Jul 25, 2026
Merged

fix: advisory-mode Stop hook emits its finding instead of returning silently#8
Nazim22 merged 1 commit into
mainfrom
dae/LL-7-advisory-stop-silence

Conversation

@Nazim22

@Nazim22 Nazim22 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Found by dogfooding Leadline on a real Claude Code install.

Bug. In advisory mode the Stop hook returned bare {}. decision.block is false by design in advisory, and the Stop path had no advisory branch (unlike PostToolUse), so it fell through to silence. The finding was still written to the trace, but nothing surfaced live in the session.

Why it mattered. The README tells every new user to start with --dry-run. In exactly that mode the product's headline behavior, that the agent cannot claim "done" while an obligation is unmet, was invisible. A first run showed route corrections and receipt failures but never a completion-gate finding.

Fix. One guarded line, after the existing enforce-block and anti-lockup branches:

if (engine.mode === 'advisory' && decision.message) return { systemMessage: decision.message };

systemMessage rather than hookSpecificOutput.additionalContext: per the Claude Code hook docs, systemMessage is a user-visible warning, while Stop additionalContext continues the agent loop, which would undermine the advisory fail-open invariant.

Verification (independently reproduced by the reviewer):

  • npm test 232/232 in a clean worktree
  • npm run bench unchanged (62.5% / 61.1% / 0-4 / 1-1 / 0-2)
  • Advisory Stop with an unmet obligation now returns {"systemMessage":"Unmet obligation: ... Satisfy it via ... Alternatively, explicitly abstain"} and no decision key, so it still never blocks
  • Advisory Stop with nothing outstanding returns {}, so there is no false noise
  • Enforce and anti-lockup paths untouched

🤖 Generated with Claude Code

@Nazim22
Nazim22 merged commit 8d2b7a7 into main Jul 25, 2026
5 of 6 checks passed
@Nazim22
Nazim22 deleted the dae/LL-7-advisory-stop-silence branch July 25, 2026 18:00
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