Skip to content

feat(cli): optional notify when blocked on approval#106

Open
ZakAnun wants to merge 2 commits intohuggingface:mainfrom
ZakAnun:main
Open

feat(cli): optional notify when blocked on approval#106
ZakAnun wants to merge 2 commits intohuggingface:mainfrom
ZakAnun:main

Conversation

@ZakAnun
Copy link
Copy Markdown

@ZakAnun ZakAnun commented Apr 24, 2026

Summary

Adds an optional notification when the interactive CLI blocks on tool approval, so users who run ml-intern in the background get a ping without polling the terminal.

Closes #103

What changed

  • New flags: --notify-on-block and --notify-method {auto,bell,desktop} (interactive mode only; headless unchanged).
  • auto: tries desktop notification when available (osascript on macOS, notify-send on Linux), otherwise falls back to the terminal bell (\a).
  • bell / desktop force the chosen transport; desktop failures fall back to bell where appropriate.
  • Notification runs when handling approval_required and not in yolo auto-approve mode, immediately before the approval UI.
  • Unit tests in tests/unit/test_main_notifications.py for the notification helpers.
  • README usage line for the new flags.

Out of scope (issue listed as possibilities)

  • Windows notifu (Windows still gets bell via auto when no desktop helper is wired).
  • User-provided callback hook (could be a follow-up if desired).

How to test

uv sync --extra dev
uv run pytest tests/unit/test_main_notifications.py -v

Add --notify-on-block and --notify-method (auto/bell/desktop) to alert
users when the interactive CLI waits for tool approval. Uses terminal
bell, osascript on macOS, and notify-send on Linux with sensible
fallbacks. Includes unit tests for notification helpers.

Related to huggingface#103

Made-with: Cursor
@ZakAnun
Copy link
Copy Markdown
Author

ZakAnun commented Apr 26, 2026

@akseljoonas Hello, should I wait for #107 to be merged and then proceed with the automatic Claude review? Because automatic review still doesn't work after resynchronizing the main upstream.

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.

Notify user when intern needs input

1 participant