Skip to content

Events Reference

CopilotOnToast registers seven Copilot CLI hook events. This page describes each one — when it fires, the default notification it shows, and any relevant notes.

Event keyNotification titleNotification bodyWhen it fires
sessionStartCopilot – StartedSession started.A Copilot CLI session begins
sessionEndCopilot – DoneSession ended: {reason}A Copilot CLI session ends
agentStopCopilot – Turn CompleteAgent finished responding.The agent finishes a turn
permissionRequestCopilot – Action NeededAwaiting approval for: {tool}Copilot asks to use a tool
errorOccurredCopilot – Error{error message}An error occurs during the session
userPromptSubmittedCopilot – Prompt Sent{prompt preview}The user submits a prompt
postToolUseFailureCopilot – Tool FailedTool failed: {tool}A tool call fails after execution

This is the most useful event for “done” alerts — it fires whenever the agent finishes a turn and is waiting for your input. If you only want one notification enabled, this is the one.

Fires when Copilot needs your approval before using a tool. This fires before the permission service runs, so it fires even in /yolo mode. See Yolo mode tip to disable it for yolo sessions.

The notification body includes the session end reason (e.g., user_ended, timeout).

The notification body shows a preview of the prompt text. Useful as a confirmation that your prompt was received, though most users prefer to disable this one to reduce noise.

Fires after a tool call completes with a failure status. The notification body includes the name of the tool that failed.