Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:42 evey Hermes plugins Fail Safe Collectors

From Leeroopedia
Knowledge Sources
Domains Error_Handling, Resilience, Signal_Collection
Last Updated 2026-10-29 00:00 GMT

Overview

Wrap each signal collector in its own try/except so one failing source never prevents the rest from contributing actions to the priority queue.

Description

The autonomy engine's decide_handler runs six independent signal collectors (bridge, goals, projects, memory, cron, time). Rather than letting a single collector failure abort the entire decision loop, each collector is invoked inside a per-source try/except block. If a collector raises, its count is recorded as "err:{message}" and the loop continues with the remaining sources. This means a missing bridge.db, an unreadable goals.md, or a broken git repo never blocks the agent from deciding its next action.

The same pattern appears in the digest plugin, where every aggregation function (_get_costs, _get_cron, _get_bridge, _get_goals, _get_alerts) wraps in try/except and returns zero/empty defaults on failure.

Usage

Use this heuristic when building any multi-source aggregation pipeline — decision engines, digest generators, status dashboards. Apply it whenever one source being unavailable should not prevent the others from being queried.

The Insight (Rule of Thumb)

  • Action: Wrap each collector/aggregator function call in its own try/except block.
  • Value: On exception, record the error string (e.g., "err:{e}") and return an empty list or zero-valued dict — never re-raise.
  • Trade-off: Errors are silently absorbed per-source. You lose visibility into individual collector failures unless you inspect the returned error counts. The trade-off is worth it: a degraded decision is better than no decision.
  • Compatibility: Works with any number of collectors; the caller should display error counts so the operator can investigate later.

Reasoning

An autonomous agent that runs 24/7 cannot afford a single point of failure in its decision loop. If bridge.db is locked or goals.md is mid-write, the agent should still be able to decide to run memory_maintenance or cost_review. The fail-safe pattern ensures the decision loop degrades gracefully: the worst case is "fewer candidate actions" rather than "agent is stuck."

The digest plugin applies the same logic: if Langfuse is down, costs show $0 but cron health is still accurate. Each source degrades independently.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment