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

Principle:23blocks OS Ai maestro Status Snapshot Persistence

From Leeroopedia
Knowledge Sources
Domains Status_Presence, Persistence
Last Updated 2026-10-26 10:00 GMT

Overview

A snapshot persistence pattern that receives agent status reports (model, context, cost, effort, mode) from hooks, validates fields, and serves them merged across local and remote hosts.

Description

The status snapshot service receives reports from agent hooks. `ingestStatusSnapshot` validates the fields (model, modelId, sessionId, effort), checks the agent exists, bounds the payload size, and keeps the report in memory. `getSnapshots` returns a map of agent name → snapshot by merging local snapshots with cached remote host snapshots.

Unknown fields are dropped; the report writes nothing to disk (in-memory only). The snapshot enriches the presence display with model context, cost, and effort information.

Usage

Use this principle when designing a status enrichment system where:

  • Hooks post lightweight status reports (not full state)
  • Reports must be validated (field types, size bounds, agent existence)
  • Snapshots merge across local and remote hosts

Theoretical Basis

The snapshot is a validated in-memory report:

ingest(agentId, body):
  validate: agentId is a string, body is an object, size < MAX
  check: agent exists in registry
  extract: model, modelId, sessionId, effort (unknown fields dropped)
  store: in-memory map[agentName] = snapshot

getSnapshots():
  merge: local snapshots + remote host snapshots (cached)
  return: agent name → snapshot

Related Pages

Implemented By

Page Connections

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