Skip to content

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

Open
ZakAnun wants to merge 11 commits into
huggingface:mainfrom
ZakAnun:main
Open

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

Conversation

@ZakAnun

@ZakAnun ZakAnun commented Apr 24, 2026

Copy link
Copy Markdown

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

ZakAnun commented Apr 26, 2026

Copy link
Copy Markdown
Author

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

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 added 2 commits May 6, 2026 15:33
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

ZakAnun commented May 6, 2026

Copy link
Copy Markdown
Author

Hi @lewtun 👋

This PR is ready for review. A few notes:

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

ZakAnun and others added 4 commits May 11, 2026 11:16
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
ZakAnun added 2 commits June 11, 2026 17:16
# Conflicts:
#	README.md
#	agent/main.py
# Conflicts:
#	README.md
#	agent/main.py
#	tests/unit/test_main_notifications.py
@ZakAnun

ZakAnun commented Jun 11, 2026

Copy link
Copy Markdown
Author

Hi @lewtun, this PR has been synced with the latest upstream/main and the merge conflicts have been resolved. The branch is ready for review when you have a chance. Thanks!

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