From dac3ae4a053d686f50861e05fe5afd69cc98f1d4 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 2 Mar 2026 18:36:58 -0800 Subject: [PATCH] fix: raise default heartbeat interval to 4h, add cost warning in wizard (#467) --- src/main.ts | 4 ++-- src/onboard.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index a229f8c..bbe88cd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -704,7 +704,7 @@ async function main() { const heartbeatConfig = agentConfig.features?.heartbeat; const heartbeatService = new HeartbeatService(bot, { enabled: heartbeatConfig?.enabled ?? false, - intervalMinutes: heartbeatConfig?.intervalMin ?? 30, + intervalMinutes: heartbeatConfig?.intervalMin ?? 240, skipRecentUserMinutes: heartbeatConfig?.skipRecentUserMin ?? globalConfig.heartbeatSkipRecentUserMin, agentKey: agentConfig.name, prompt: heartbeatConfig?.prompt || process.env.HEARTBEAT_PROMPT, @@ -793,7 +793,7 @@ async function main() { channels: status.channels, features: { cron: cfg?.features?.cron ?? globalConfig.cronEnabled, - heartbeatIntervalMin: hbCfg?.enabled ? (hbCfg.intervalMin ?? 30) : undefined, + heartbeatIntervalMin: hbCfg?.enabled ? (hbCfg.intervalMin ?? 240) : undefined, }, }; }); diff --git a/src/onboard.ts b/src/onboard.ts index 504a074..2b4aede 100644 --- a/src/onboard.ts +++ b/src/onboard.ts @@ -814,12 +814,18 @@ async function stepFeatures(config: OnboardConfig): Promise { config.heartbeat.enabled = setupHeartbeat; if (setupHeartbeat) { + p.log.warn( + 'Each heartbeat triggers a full agent invocation — real API cost, billed by your model.\n' + + 'A 30-minute interval runs 48 invocations/day. A 4-hour interval runs 6.\n' + + 'Most heartbeats are no-ops, but you pay for each one regardless.\n' + + 'Set a longer interval if you\'re watching your spend.' + ); const interval = await p.text({ message: 'Interval (minutes)', - placeholder: '30', - initialValue: config.heartbeat.interval || '30', + placeholder: '240', + initialValue: config.heartbeat.interval || '240', }); - if (!p.isCancel(interval)) config.heartbeat.interval = interval || '30'; + if (!p.isCancel(interval)) config.heartbeat.interval = interval || '240'; } // Cron