Skip to main content
Use agent lifecycle hooks to call midway send-text when an agent finishes or needs approval. Choose your agent’s guide: Use midway send-text --background in hooks so the notification send continues if the agent or hook process is interrupted. The detached process is still subject to system shutdown, explicit termination, and teardown of ephemeral environments. Before enabling a hook:
  • Make sure midway is on the hook process’s PATH.
  • Make sure the hook’s working directory contains midway.yaml; background sends use the default config in their working directory.
  • Configure notification destinations in Midway. See configuration and the notification guides.
For example, to select a config explicitly:
Hooks execute commands with your user permissions. Only add hook commands you trust. A completion event can fire more than once per session, so notifications may be sent for each completed turn rather than only when you close the agent.