feat(hooks): add question.asked and session.error notifications #1145
+203
−0
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
Add OS notifications for two additional event types that were previously not covered:
question.asked: Notifies when the agent asks a question (e.g., during Prometheus interview sessions)session.error: Notifies when the session encounters an error (e.g., "The final block in an assistant message cannot be thinking")Problem
Currently,
session-notification.tsonly triggers notifications onsession.idleevents. This means:Solution
Added handlers for both event types following the existing patterns:
Test Coverage
Added 7 new test cases covering:
question.askednotification for main sessionquestion.askedskipped for subagentquestion.askedskipped for non-main sessionsession.errornotification for main sessionsession.errorskipped for subagentsession.errorskipped for non-main sessionsession.errorwith missing error message (fallback to default)Verification
bun test src/hooks/session-notification.test.ts)tsc --noEmit)Summary by cubic
Add OS notifications for question.asked and session.error so users see prompts and failures immediately. This prevents missed questions during interviews and silent session errors.
Written for commit 91d488c. Summary will update on new commits.