SubagentStop write path
Last line of agent-usage.jsonl
Verdict:
Why the suite stayed green — and the guard that fixes it
The old wiring test only asserted the two flattened entries, never the dispatcher itself. This PR adds the missing registration assertion plus a real-filesystem write test.
// src/hooks/src/__tests__/e2e/dispatcher-registry-wiring.test.ts + it('should register subagent-stop/unified-dispatcher on SubagentStop', () => { + const hooks = (hooksConfig.hooks.SubagentStop || []).flatMap(g => g.hooks); + const dispatcher = hooks.find(h => commandPath(h).includes('subagent-stop/unified-dispatcher')); + expect(dispatcher).toBeDefined(); // ← would have failed for 78 days + expect(dispatcher?.async).toBe(true); + });
Verify it live (any session)
tail -1 ~/.claude/analytics/agent-usage.jsonl # fresh ts = writer is alive