Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(settings): remove heartbeat planner and subconscious tick from AI panel

Steven Enamakel9b934f86773c
diff --git a/app/src/components/settings/panels/AIPanel.tsx b/app/src/components/settings/panels/AIPanel.tsx
index 53072cf410..d676f1ce8d 100644
--- a/app/src/components/settings/panels/AIPanel.tsx
+++ b/app/src/components/settings/panels/AIPanel.tsx
@@ -50,14 +50,6 @@ import {
type AuthStyle,
openhumanUpdateLocalAiSettings,
} from '../../../utils/tauriCommands/config';
-import {
- type HeartbeatPlannerSummary,
- type HeartbeatSettings,
- type HeartbeatSettingsPatch,
- openhumanHeartbeatSettingsGet,
- openhumanHeartbeatSettingsSet,
- openhumanHeartbeatTickNow,
-} from '../../../utils/tauriCommands/heartbeat';
import { ConfirmationModal } from '../../intelligence/ConfirmationModal';
import PanelPage from '../../layout/PanelPage';
import Button from '../../ui/Button';
@@ -1119,41 +1111,20 @@ export const BackgroundLoopControls = ({
hideHeader?: boolean;
}) => {
const { t } = useT();
- const [settings, setSettings] = useState<HeartbeatSettings | null>(null);
const [usage, setUsage] = useState<TeamUsage | null>(null);
const [transactions, setTransactions] = useState<CreditTransaction[]>([]);
const [connections, setConnections] = useState<ComposioConnection[]>([]);
const [loading, setLoading] = useState(true);
- const [saving, setSaving] = useState<string | null>(null);
- const [runningTick, setRunningTick] = useState(false);
- const [plannerSummary, setPlannerSummary] = useState<HeartbeatPlannerSummary | null>(null);
const [error, setError] = useState<string>('');
- const settingsRef = useRef<HeartbeatSettings | null>(null);
- const patchRequestIdRef = useRef(0);
-
- const commitSettings = useCallback((nextSettings: HeartbeatSettings | null) => {
- settingsRef.current = nextSettings;
- setSettings(nextSettings);
- }, []);
const refresh = useCallback(async () => {
setLoading(true);
setError('');
- const [heartbeatResult, usageResult, transactionsResult, connectionsResult] =
- await Promise.allSettled([
- openhumanHeartbeatSettingsGet(),
- creditsApi.getTeamUsage(),
- creditsApi.getTransactions(200, 0),
- listComposioConnections(),
- ]);
-
- if (heartbeatResult.status === 'fulfilled') {
- commitSettings(heartbeatResult.value.result.settings);
- } else {
- setError(
- heartbeatResult.reason instanceof Error ? heartbeatResult.reason.message : 'Load failed'
- );
- }
+ const [usageResult, transactionsResult, connectionsResult] = await Promise.allSettled([
+ creditsApi.getTeamUsage(),
+ creditsApi.getTransactions(200, 0),
+ listComposioConnections(),
+ ]);
if (usageResult.status === 'fulfilled') {
setUsage(usageResult.value);
@@ -1167,85 +1138,26 @@ export const BackgroundLoopControls = ({
setConnections(connectionsResult.value.connections ?? []);
}
setLoading(false);
- }, [commitSettings]);
+ }, []);
useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
void refresh();
}, [refresh]);
- const applyHeartbeatPatch = useCallback(
- async (patch: HeartbeatSettingsPatch) => {
- const requestId = patchRequestIdRef.current + 1;
- patchRequestIdRef.current = requestId;
- const savingKey = Object.keys(patch).join(',');
- const previous = settingsRef.current;
- setError('');
- setSaving(savingKey);
- if (!previous) {
- // No baseline to patch against — abandon this request.
- if (patchRequestIdRef.current === requestId) {
- setSaving(null);
- }
- return;
- }
- commitSettings({ ...previous, ...patch });
- try {
- const response = await openhumanHeartbeatSettingsSet(patch);
- // Stale response — a newer patch superseded us; drop this result.
- if (patchRequestIdRef.current !== requestId) return;
- commitSettings(response.result.settings);
- } catch (err) {
- if (patchRequestIdRef.current !== requestId) return;
- commitSettings(previous);
- setError(err instanceof Error ? err.message : String(err));
- } finally {
- if (patchRequestIdRef.current === requestId) {
- setSaving(null);
- }
- }
- },
- [commitSettings]
- );
-
- const runPlannerNow = useCallback(async () => {
- setRunningTick(true);
- setError('');
- try {
- const response = await openhumanHeartbeatTickNow();
- setPlannerSummary(response.result.summary);
- await refresh();
- } catch (err) {
- setError(err instanceof Error ? err.message : String(err));
- } finally {
- setRunningTick(false);
- }
- }, [refresh]);
-
const spendSample = summarizeSpendSample(transactions);
const spendRows = spendSample.rows;
const actionSummary = summarizeSpendByAction(transactions);
const hourSummary = summarizeSpendByHour(transactions);
const latestSpend = spendRows[0] ?? null;
- const heartbeatIntervalMinutes = settings ? Math.max(settings.interval_minutes, 5) : 5;
- const heartbeatTicksPerWeek = settings?.enabled
- ? Math.ceil(WEEK_MINUTES / heartbeatIntervalMinutes)
- : 0;
const activeConnections = connections.filter(activeConnection);
- const activeCalendarConnections = activeConnections.filter(isCalendarConnection);
- const maxCalendarConnectionsPerTick = settings
- ? Math.max(settings.max_calendar_connections_per_tick ?? 2, 1)
- : 2;
- const calendarConnectionsPolled = settings?.notify_meetings
- ? Math.min(activeCalendarConnections.length, maxCalendarConnectionsPerTick)
- : 0;
- const calendarConnectionsSkipped = settings?.notify_meetings
- ? Math.max(activeCalendarConnections.length - calendarConnectionsPolled, 0)
- : 0;
- const calendarPlannerCallsPerTick = settings?.notify_meetings ? 1 + calendarConnectionsPolled : 0;
- const calendarPlannerCallsPerWeek = heartbeatTicksPerWeek * calendarPlannerCallsPerTick;
- const subconsciousModelCallsPerWeek =
- settings?.enabled && settings.inference_enabled ? heartbeatTicksPerWeek : 0;
+ // The heartbeat planner and the subconscious tick were removed with the
+ // subconscious domain, so neither contributes scheduled wakeups or calendar
+ // reads any more. Kept as named zeros so the ledger arithmetic below still
+ // reads as "everything that runs in the background", rather than silently
+ // dropping the terms.
+ const heartbeatTicksPerWeek = 0;
+ const calendarPlannerCallsPerWeek = 0;
const composioPeriodicTicksPerWeek = Math.ceil(WEEK_MINUTES / COMPOSIO_PERIODIC_TICK_MINUTES);
const learningTicksPerWeek = Math.ceil(WEEK_MINUTES / LEARNING_REBUILD_MINUTES);
const memoryPollsPerWeek = Math.ceil((WEEK_MINUTES * 60 * MEMORY_WORKERS) / MEMORY_POLL_SECONDS);
@@ -1280,27 +1192,6 @@ export const BackgroundLoopControls = ({
: 'n/a';
const loops = [
- {
- name: 'Heartbeat planner',
- enabled: Boolean(settings?.enabled),
- cadence: `${settings?.interval_minutes ?? 5} min`,
- route: describeProvider(routing.heartbeat, cloudProviders),
- work: 'Runs proactive collectors: cron reminders, calendar meetings, relevant notifications.',
- risk: settings?.notify_meetings
- ? `${calendarPlannerCallsPerTick} Composio read call(s)/tick; ${calendarConnectionsSkipped} calendar link(s) over cap skipped.`
- : 'Calendar collector off; planner reads only local enabled categories.',
- },
- {
- name: 'Subconscious tick',
- enabled: Boolean(settings?.enabled && settings?.inference_enabled),
- cadence: `${settings?.interval_minutes ?? 5} min`,
- route: describeProvider(routing.subconscious, cloudProviders),
- work: 'Evaluates subconscious tasks/reflections through kind=subconscious_tick.',
- risk:
- subconsciousModelCallsPerWeek > 0
- ? `${formatCount(subconsciousModelCallsPerWeek)} model call(s)/week at current interval.`
- : 'Inference off; no scheduled subconscious model calls.',
- },
{
name: 'Memory tree workers',
enabled: true,