Skip to content

fm-wake-drain: OPEN DECISIONS fold becomes multi-minute on large status logs #2808

Description

@armchairo

Observed 2026-08-23 (main home): bin/fm-wake-drain.sh stopped completing within 120s. The queue itself was drained fine; the hang is the OPEN DECISIONS folding pass, which does per-line shell parsing (read -r + _fm_decision_key + printf per line) over every task status log. With one lane's status log at ~330KB and several others large, the fold now takes minutes of CPU-bound shell, so every wake-handling turn stalls and callers time out. Suggested fixes: fold with one awk pass instead of a shell read loop, and/or bound the fold to the last N KB per log with an explicit 'older history omitted' marker (the drain already byte-caps its OUTPUT - the cost is the scan, not the print).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-prTriage: real bug or VISION-aligned feature, open for a PR

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions