Skip to content

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

Open
ZakAnun wants to merge 1 commit into
huggingface:mainfrom
ZakAnun:main
Open

feat(cli): optional notify when blocked on approval#106
ZakAnun wants to merge 1 commit into
huggingface: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

@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.

ZakAnun added a commit to ZakAnun/ml-intern that referenced this pull request May 6, 2026
Resolved conflicts in README.md and agent/main.py:
- README.md: Kept PR huggingface#106 --notify-on-block docs + upstream sharing traces section
- agent/main.py: Kept upstream _handle_share_traces_command + PR huggingface#106 notification params
- agent/main.py: Kept upstream argparse formatting + PR huggingface#106 --notify-on-block/--notify-method args

Upstream highlights (25 commits): MongoDB sessions, sandbox auto-start, YOLO
approval budget, prompt caching, CI for tests, share traces, telemetry, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@ZakAnun
Copy link
Copy Markdown
Author

ZakAnun commented May 6, 2026

Hi @lewtun 👋

This PR is ready for review. A few notes:

Would appreciate a review when you get a chance. Thanks!

ZakAnun added a commit to ZakAnun/ml-intern that referenced this pull request May 12, 2026
Combine sandbox_tools CLI/runtime from upstream with notify-on-block and notify-method from PR huggingface#106.

Co-authored-by: Cursor <cursoragent@cursor.com>
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
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