Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(compact): scheduled auto-compact ships default-OFF with a Settings switch

Chaitanya Giric438512d6a64
diff --git a/src/main/config.ts b/src/main/config.ts
index 4202645c..d462ed86 100644
--- a/src/main/config.ts
+++ b/src/main/config.ts
@@ -86,17 +86,20 @@ export const HEARTBEAT_MISSION: ScheduledMission = {
* ops standup so editing/replacing a standup can never silently disable
* compaction again (the bug this fixes). It fires ONLY the auto-compact signal —
* `kind:'compact'` makes syncMissions skip the hive.send dispatch (empty to/body).
- * Shipped ENABLED: auto-compact is REQUIRED for long-running agents — without it
- * each agent's terminal context grows until it overflows and the agent fails. It
- * is the SINGLE source of truth for compaction (migration drops autoCompact off
- * other missions), and it's persistent: deleting it makes it reappear DISABLED. */
+ * Shipped DISABLED (v0.3.4 founder decision): scheduled compaction is opt-in.
+ * Turn it on in Settings → General or the Schedules tab; the Schedules warning
+ * panel explains the risk of leaving it off for long-running agents. It is the
+ * SINGLE source of truth for compaction (migration drops autoCompact off other
+ * missions), and it's persistent: deleting it makes it reappear DISABLED.
+ * Existing installs keep whatever enabled state the user already has
+ * (compactMaintenanceSeeded guards re-seeding). */
export const COMPACT_MAINTENANCE_MISSION: ScheduledMission = {
id: 'compact-maintenance',
label: 'Auto-compact (maintenance)',
intervalMs: 3_600_000,
to: '',
body: '',
- enabled: true,
+ enabled: false,
autoCompact: true,
kind: 'compact'
};
diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx
index eb49939c..a12080c1 100644
--- a/src/renderer/src/components/SettingsModal.tsx
+++ b/src/renderer/src/components/SettingsModal.tsx
@@ -239,6 +239,24 @@ export function SettingsModal({ config, onClose }: SettingsModalProps) {
finally { setKgBusy(false); }
};
+ // ─── Scheduled auto-compact — the compact-maintenance mission's enabled flag.
+ // The mission itself stays the single source of truth (SchedulesTab edits the
+ // same field); this is just a General-section shortcut. Default OFF (v0.3.4).
+ const [autoCompactOn, setAutoCompactOn] = useState<boolean>(
+ (config.missions ?? []).some((m) => m.id === 'compact-maintenance' && m.enabled)
+ );
+ const toggleAutoCompact = async () => {
+ const next = !autoCompactOn;
+ setAutoCompactOn(next);
+ try {
+ const cfg = await window.cth.getConfig();
+ const missions = (cfg.missions ?? []).map((m) =>
+ m.id === 'compact-maintenance' ? { ...m, enabled: next } : m
+ );
+ await window.cth.updateConfig({ missions });
+ } catch { setAutoCompactOn(!next); }
+ };
+
// --- Free Flow (voice dictation → message queue) ---
const setFreeflowEnabledStore = useStore((s) => s.setFreeflowEnabled);
const setHasGroqKeyStore = useStore((s) => s.setHasGroqKey);
@@ -724,6 +742,37 @@ export function SettingsModal({ config, onClose }: SettingsModalProps) {
<div style={{ height: 1, background: 'var(--cth-ink-300)' }} />
+ {/* Scheduled auto-compact (compact-maintenance mission) */}
+ <div>
+ <div style={{
+ fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px',
+ color: 'var(--cth-ink-500)', textTransform: 'uppercase', marginBottom: 10
+ }}>
+ Maintenance
+ </div>
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
+ <span style={{ fontSize: 14, lineHeight: '20px', color: 'var(--cth-ink-900)' }}>
+ Scheduled auto-compact
+ </span>
+ <span style={{ fontSize: 12, lineHeight: '16px', color: 'var(--cth-ink-500)' }}>
+ Queue /compact for every agent on a schedule (hourly by default; interval
+ in the Schedules tab). Off by default — long-running agents may overflow
+ their context without it.
+ </span>
+ </div>
+ <PixelButton
+ variant={autoCompactOn ? 'primary' : 'secondary'}
+ size="sm"
+ onClick={toggleAutoCompact}
+ >
+ {autoCompactOn ? 'on' : 'off'}
+ </PixelButton>
+ </div>
+ </div>
+
+ <div style={{ height: 1, background: 'var(--cth-ink-300)' }} />
+
{/* Circuit breaker */}
<div>
<div style={{