From 7086061c83315bb0a53bca883de2f7ac82167beb Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 17 May 2026 06:05:11 -0700 Subject: [PATCH] =?UTF-8?q?fix(@scripts/session-tools):=20=F0=9F=90=9B=20f?= =?UTF-8?q?ix=20triage=20sorting=20for=20global=20priority=20display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/rclaude | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/rclaude b/bin/rclaude index 6222c6e..259e821 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -421,7 +421,13 @@ cmd_resume() { # picker even when triage produces > (35 - tmux_count) rows on a single # host that would otherwise crowd them out. _tmux=$(scan_hosts | while IFS= read -r h; do list_tmux_on "$h"; done) - _triage=$(scan_hosts | while IFS= read -r h; do list_triage_on "$h"; done) + # Triage rows: col 4 = priority, col 9 = mtime. Each host's rows come + # pre-sorted by priority desc, but the per-host blocks are concatenated + # so a P5 on apricot would sit after all local rows and get truncated. + # Re-sort globally by (priority desc, mtime desc) so the top of the + # picker is the actual highest priority across the fleet. + _triage=$(scan_hosts | while IFS= read -r h; do list_triage_on "$h"; done \ + | sort -t"$(printf '\t')" -k4,4nr -k9,9nr) _t_count=0 [ -n "$_tmux" ] && _t_count=$(printf '%s\n' "$_tmux" | wc -l | tr -d ' ') [ -n "$_triage" ] && _d_total=$(printf '%s\n' "$_triage" | wc -l | tr -d ' ')