Skip to main content

read_recent_activity_digest

Function read_recent_activity_digest 

Source
pub fn read_recent_activity_digest(
    filestore: &FileStore,
    block_id: &str,
) -> Option<String>
Expand description

Read the last 96 KB of a block’s FileStore output, extract digest entries from all of it, and keep the newest few (finalize_digest). Used directly by next_prompt_suggestion; activity_summary now only falls back to this when the caller didn’t supply user_message (see docs/specs/SPEC_AMBIENT_PANE_TITLE_OVERALL_GOAL_TRACKING_2026_08_17.md) — the common case passes the literal just-submitted text instead. Returns None when there’s nothing usable — callers should return an empty ambient result in that case without invoking the CLI.

EVENT_BLOCK_FILE events have persist: 0 so the ring buffer is always empty — FileStore is the only reliable source. Tail-reading avoids loading multi-MB output files on every turn; 96 KB covers the newest entries even on a streaming session full of delta lines.