tinyhumansai/openhuman · error

[subconscious] setMode failed:

Error message

[subconscious] setMode failed:

What it means

Failure of setMode in useSubconscious: the hook optimistically sets the local mode state, then persists via openhumanHeartbeatSettingsSet({subconscious_mode}) and refreshes; the RPC rejected. The catch warns and sets a user-readable error, but note the optimistic local state is NOT rolled back — UI and persisted config can diverge until the next refresh().

Source

Thrown at app/src/hooks/useSubconscious.ts:140

    } finally {
      setTriggeringKinds(prev => {
        const next = new Set(prev);
        next.delete(kind);
        return next;
      });
    }
  }, []);

  const setMode = useCallback(
    async (newMode: SubconsciousMode) => {
      if (!isTauri()) return;
      setSettingMode(true);
      setModeState(newMode);
      try {
        await openhumanHeartbeatSettingsSet({ subconscious_mode: newMode });
        await refresh();
      } catch (err) {
        console.warn('[subconscious] setMode failed:', err);
        setError(err instanceof Error ? err.message : 'Failed to update mode');
      } finally {
        setSettingMode(false);
      }
    },
    [refresh]
  );

  const setIntervalMinutes = useCallback(async (minutes: number) => {
    if (!isTauri()) return;
    setIntervalState(minutes);
    try {
      await openhumanHeartbeatSettingsSet({ interval_minutes: minutes });
    } catch (err) {
      console.warn('[subconscious] setInterval failed:', err);
    }
  }, []);

View on GitHub (pinned to 7491200858)

Solutions

  1. Call refresh() after failure to re-sync local state from persisted config
  2. Check core config-write permissions if the failure is persistent
  3. Roll back the optimistic mode in the catch to avoid divergence
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at app/src/hooks/useSubconscious.ts:140 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/3f3ced689eeb3623. Report an issue: GitHub.