← Back to PRs

#16831: feat(status): group cron sessions for readability

by puritysb open 2026-02-15 05:17 View on GitHub →
commands size: M
## Summary Implements #16799 — Improve `openclaw status` UX for cron-heavy setups. ## Changes - Adds `sessionType` classification (`main`/`cronJob`/`cronRun`/`other`) to session entries - Adds grouped session buckets to `StatusSummary.sessions.grouped`: - **Active**: Primary interactive sessions - **Cron Jobs**: Cron job definitions - **Recent Runs**: Individual cron execution history (collapsed when > 20) - **Other**: Everything else - Basic unit tests for session type classification ## Future Work (out of scope for this PR) - Wire grouped output into the human-readable `openclaw status` printer - Add snapshot/regression tests for status output - Align token % with model contextWindow (tracked in #15726) ## Related - Issue: #16799 - Related: #12899, #13900, #15726, #10936, #12578, #9455, #13601 <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds session type classification and grouping infrastructure to improve `openclaw status` UX for cron-heavy setups. Sessions are now categorized as `main` (interactive), `cronJob` (definitions), `cronRun` (execution history), or `other`, with grouped output buckets that collapse when cron runs exceed 20 entries. The implementation correctly uses canonical session-key utilities (`isCronJobSessionKey`, `isCronRunSessionKey`) for cron detection, addressing previous review feedback about regex consistency. Tests properly import the actual classification functions rather than duplicating logic. - Added `sessionType` field to `SessionStatus` with four classification types - Added `SessionGroups` structure with Active/Cron Jobs/Recent Runs/Other buckets - Implemented `classifySessionType()` that delegates to canonical helpers for cron detection - Implemented `groupSessions()` with automatic collapsing when cron runs > 20 - Added `isCronJobSessionKey()` helper alongside existing `isCronRunSessionKey()` in session-key-utils - Enhanced `isCronRunSessionKey()` implementation from regex to explicit part validation - Comprehensive unit tests for classification and grouping logic <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is well-structured with proper separation of concerns, comprehensive test coverage, and addresses previous review feedback. The code uses canonical session-key utilities correctly, includes clear documentation, and follows TypeScript best practices. All changes are additive (new fields are optional), ensuring backward compatibility. The test suite validates both classification logic and grouping behavior including edge cases. - No files require special attention <sub>Last reviewed commit: 0d47412</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs