agent.log(message, options?) requires a string and writes to the user’s activity feed. The only option is { error: true }. Objects, arrays and unsupported options fail typechecking and throw at runtime; valid log delivery is best-effort and never fails the run.
JSON.stringify. Preserve full non-secret provider errors and causes. Console output is process diagnostics, not user-visible activity.
agent.notify({ message, key? }) sends the user a push notification titled with the agent’s name and lists it in their Circuit notifications; tapping it opens the session. Use it for events the user asked to hear about. It returns { sent }; a key sends at most once per session, so a repeated condition alerts once and later calls return sent: false. A session may send 30 notifications per hour, unsent repeats aside; more return sent: false and are not delivered. Unopened notifications from the last day count toward the unread badge on the user’s account. Local circuit run and backtests print sent notifications instead of pushing them.