Skip to content

Conversation

@1code-async
Copy link
Contributor

@1code-async 1code-async bot commented Jan 29, 2026

Summary

  • Adds a native OS notification when the Claude agent uses the AskUserQuestion tool (multichoice prompts)
  • Notification only appears when the app window is not focused, helping users know when the agent needs input even if they've switched to another application
  • Uses existing notifyAgentNeedsInput() function which respects user notification settings and includes priority-based throttling

Implementation

Added a useEffect in ChatViewInner that watches for changes to pendingQuestions (from pendingUserQuestionsAtom). When a new question arrives (tracked by toolUseId), it triggers notifyAgentNeedsInput() which:

  • Checks if window is focused (doesn't notify if user is already looking at the app)
  • Respects the user's notification preferences
  • Uses priority-based throttling to prevent notification spam

Test plan

  • Open a chat and start an agent task that will ask a question
  • Switch to another application while the agent is working
  • Verify a notification appears when the agent asks a multichoice question
  • Verify no notification appears if you stay focused on the app
  • Verify notifications respect the user's notification settings

Fixes: ENG-586

🤖 Generated with Claude Code

…estion

Shows a native OS notification when the Claude agent uses the AskUserQuestion
tool to prompt the user with a multichoice question. The notification only
appears when the app window is not focused, helping users know when the agent
needs their input even if they've switched to another application.

Uses the existing notifyAgentNeedsInput() function which respects the user's
notification settings and includes priority-based throttling to prevent spam.

Fixes: ENG-586

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

0 participants