Skip to content

Conversation

@orientpine
Copy link

@orientpine orientpine commented Jan 26, 2026

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.ts only triggers notifications on session.idle events. This means:

  1. When Prometheus asks clarifying questions, users don't get notified and may miss the prompt
  2. When sessions encounter errors and stop, users don't get notified about the failure

Solution

Added handlers for both event types following the existing patterns:

  • Skip subagent sessions
  • Only notify for main session
  • Immediate notification (no confirmation delay needed)
  • Error messages are truncated to 100 characters for readability

Test Coverage

Added 7 new test cases covering:

  • question.asked notification for main session
  • question.asked skipped for subagent
  • question.asked skipped for non-main session
  • session.error notification for main session
  • session.error skipped for subagent
  • session.error skipped for non-main session
  • session.error with missing error message (fallback to default)

Verification

  • All 18 tests pass (bun test src/hooks/session-notification.test.ts)
  • TypeScript type check passes (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.

  • New Features
    • Notify on question.asked for the main session; ignore subagent and non-main sessions.
    • Notify on session.error with the error message truncated to 100 chars.
    • Immediate notification; optional sound uses existing config.

Written for commit 91d488c. Summary will update on new commits.

Add notifications for two additional events:
- question.asked: Notifies when agent asks a question (Prometheus interview)
- session.error: Notifies when session encounters an error (e.g., thinking block errors)

Both handlers follow existing patterns:
- Skip subagent sessions
- Only notify for main session
- Immediate notification (no delay)

Includes comprehensive test coverage for both event types.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@orientpine
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 26, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

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