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 ' ')