feat(plugin): update council handoff, stage, and blocker state from PostToolUse (#1368)#1417
Merged
Merged
Conversation
…ostToolUse (#1368) Add council lifecycle model to on_tool_end() so PostToolUse maintains meaningful state transitions for the request-driven council UX. - Add forward-only stage advancement heuristic (opening→reviewing→consensus→done) triggered by tool completion patterns (specialist tools, edit tools, parse_mode) - Add blocker count detection from quality-check Bash output (pytest, tsc, eslint) - Guard read_hud_state behind tool_name check to avoid unnecessary disk I/O - Use specific lint patterns (yarn lint, npm run lint) to prevent false positives - Add 43 new tests (107 total) covering stage transitions, blocker detection, integration, and full request lifecycle Closes #1368
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
commented
Apr 7, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review Summary
Critical: 0 | High: 0 | Medium: 0 (resolved) | Low: 1 (accepted)
Code Quality
- Clean forward-only state machine in
_infer_council_advancewith guard clauses frozensetfor O(1) tool name lookupsOptional[int]return from_detect_blocker_count— good semantic distinction (None = don't touch)
Performance
read_hud_stateguarded behindtool_name in _council_toolscheck — no unnecessary disk I/O on non-council tools (Read/Grep/Glob etc.)
Test Coverage
- 43 new tests (64→107 total)
- Unit tests for pure functions (
_infer_council_advance,_detect_blocker_count) - Integration tests for
on_tool_end()council + blocker paths - Full lifecycle end-to-end test covering init → seed → advance → blocker → clear → done → reset
EVAL Fixes Applied
- Import ordering (
import regrouped with stdlib) - Specific lint patterns (
"yarn lint","npm run lint"instead of bare"lint") - Redundant
re.IGNORECASEremoved (output already lowercased) - Docstring updated for
on_tool_end() - 4 additional tests (prepare_parallel_agents, None output, yarn lint, npm run lint)
CI
landing-security-checkfailure is pre-existing (vite 7.3.1, GHSA-p9ff-h696-f583), unrelated- All 26 other checks pass
Ship-ready. 🚢
a1359c1 to
2a9fd45
Compare
2a9fd45 to
00e3193
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
on_tool_end()(opening→reviewing→consensus→done) triggered by tool completion patternsread_hud_statebehind tool_name check to avoid unnecessary disk I/O on non-council toolsChanges
hooks/lib/hud_helpers.py_infer_council_advance(),_detect_blocker_count(), enhancedon_tool_end()hooks/tests/test_hud_helpers.pyTestInferCouncilAdvance,TestDetectBlockerCount,TestOnToolEndCouncilAdvancement,TestFullLifecycleWithCouncilTest plan
python3 -m pytest hooks/tests/test_hud_helpers.py)Closes #1368