Skip to content

Notifications

ChrAlpha edited this page Nov 9, 2026 · 2 revisions
🇬🇧English | 🇨🇳中文

Notifications

@tmag-notify is an optional local command run for blocked and finished alerts enabled by @tmag-alert, including sessions without panes. It receives only metadata. It runs separately from the agent hook and has a 20-second bound. tmag notify sends a test alert and retains bounded command output for its foreground result. At most four cooperating external notification commands run per state directory, using permanent local lock slots inherited directly by the shell; full capacity refuses without a queue. This bounds external executions, not all short-lived detached launchers. Ordinary descendants retain their slot; commands that deliberately close inherited FDs or escape the owned process group are outside that guarantee. The existing 20-second execution bound remains.

Variable Meaning
TMAG_ALERT blocked, finished, or test
TMAG_AGENT, TMAG_SESSION agent and session identity
TMAG_STATE, TMAG_KIND state and state kind
TMAG_REQUEST, TMAG_TOOL request id and tool name
TMAG_CWD, TMAG_TARGET, TMAG_HOST local working directory, pane target, and host
TMAG_TITLE, TMAG_MESSAGE a generic summary built from metadata

The command runs unless a pane shows the session on a tmux server where the owner typed in the last minute; sessions without panes always notify. This local notification policy leaves the complete event stream unchanged. Delivery channels and client-specific links are the configured command's responsibility.

Clone this wiki locally