feat(mcp): notify_user — agent-to-OS notification surface - #61
Merged
Conversation
A backgrounded agent that finishes its work, blocks, or hits an unrecoverable state can now ping the user via the OS notification center instead of waiting silently in a terminal the user has stopped watching. macOS-only for v0.1 (osascript shell-out); non-macOS hosts log only — freedesktop / Windows toast are follow-ups when Ideate ships beyond macOS. Per-session rate limit (5s minimum gap) on Manager guards against a stuck loop or runaway script spamming the notification center. Limit is per-session so a fan-out across multiple agents stays useful; the 5s window does not advance on denied calls so a hammer keeps the quota honest. Registered on both per-idea and orchestrator MCP surfaces. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ilure Two review findings on PR #61: 1. AppleScript injection: the body and title interpolate into an `osascript -e` statement. Unescaped newlines end the current statement so `body\ndisplay dialog "x"` could smuggle a second command into the shell. Strip \r and \n before the backslash/quote escape. 2. Rate-limit rollback: a failed osascript run was burning the session's 5s quota even though no notification was delivered. Clear the slot on error so the user can retry immediately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
paultyng
marked this pull request as ready for review
June 23, 2026 13:39
paultyng
enabled auto-merge (squash)
June 23, 2026 13:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
notify_user(title, body)on both per-idea and orchestrator surfaces.osascript; non-macOS hosts log-only (no error).Manager.Closes backlog
c17aead0. Per-agent on/off and a settings UI are deferred to a follow-up.Test plan
go test ./internal/mcp/ -count=1 -race: 5 new tests cover happy path, missing-args, rate limit, per-session isolation, notifier-error pass-through.task lint,task build: clean.notify_uservia the agent, see a real macOS Notification Center banner.🤖 Generated with Claude Code