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 Activity Signal Collection

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

Overview

A signal collection pattern that gathers raw activity signals from hooks (permission needs), transcript files (Codex live status), and pane text (observed permission verdicts) to feed the status aggregation.

Description

Activity signals come from multiple sources:

  • hookNeedsYou: checks if the hook report means the agent is blocked on the user (permission_request or waiting_for_input with a blocking notification).
  • codexLiveStatusFromFile: reads the tail of a Codex transcript JSONL file to extract the live status string. Reads only the last 64KB to avoid re-reading large files.
  • observedPermissionVerdict: inspects pane text to decide whether a permission dialog is still open ('keep'), was answered ('active'), or was dismissed ('idle').

These signals feed the `getActivity` aggregation and the `normalizeActivityStatus` logic.

Usage

Use this principle when designing a status system where:

  • Signals come from heterogeneous sources (hooks, transcript files, pane text)
  • Each source has different freshness and reliability characteristics
  • Reading large files must be bounded (tail-only reads)

Theoretical Basis

Each signal collector is a pure function over a specific source:

hookNeedsYou(hookStatus, notificationType) → boolean
codexLiveStatusFromFile(filePath, tailBytes) → string | null
observedPermissionVerdict({ageMs, paneText}) → 'keep' | 'active' | 'idle'

The tail-only read for Codex transcripts is a bounded-read optimization: the last task event is near the end of the file, and re-reading the entire file on every poll would be wasteful for large rollouts.

Related Pages

Implemented By

Uses Heuristic

Page Connections

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