fix: raise default heartbeat interval to 4h, add cost warning in wizard (#467)
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -814,12 +814,18 @@ async function stepFeatures(config: OnboardConfig): Promise<void> {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user