Skip to content

Sort stopped agents below active sessions in sidebar - #3

Merged
selfcontained merged 2 commits into
mainfrom
fix/agent-sidebar-sort
Mar 10, 2026
Merged

Sort stopped agents below active sessions in sidebar#3
selfcontained merged 2 commits into
mainfrom
fix/agent-sidebar-sort

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Stopped/errored agents no longer bubble above running agents when their activity timestamp is more recent
  • Adds a session-status tier to the sidebar sort: blockedwaiting_user → active session (running, creating, stopping) → no session (stopped, error, unknown)
  • Within each tier, agents still sort by most recent activity

Problem

Stopping an agent updates its activity timestamp, which caused it to jump to the top of the sidebar above agents with live, attachable sessions.

Test plan

  • Verified with live agent data — before: crumbstream (stopped, 1h ago) sorted above media-streaming (running, 1h ago); after: all 4 running agents group at top, both stopped agents at bottom
  • Screenshots captured showing before/after sort order

🤖 Generated with Claude Code

selfcontained and others added 2 commits March 9, 2026 18:03
After a server restart the reconnect timer calls ensureTerminalConnected
which immediately hits the agent status API. That API call was outside
the try-catch block, so a network error (server still booting) threw an
uncaught exception, silently exiting the function without rescheduling —
leaving the terminal stuck at "Session disconnected, reconnecting...".

Fix: wrap the agent status fetch in its own try-catch. On network failure,
schedule a backoff retry using the same logic as scheduleReconnect so the
loop continues until the server is reachable again.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Agents with no running tmux session (stopped, error, unknown) now sort
below agents that are running, creating, or stopping — so stopping a
session no longer bumps an agent above live ones via activity timestamp.

Priority order: blocked → waiting_user → active session → no session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 29f2926 into main Mar 10, 2026
1 check passed
@selfcontained
selfcontained deleted the fix/agent-sidebar-sort branch April 9, 2026 03:01
selfcontained added a commit that referenced this pull request Jul 8, 2026
…s, seed data

- Restyle feedback items as bordered cards with visual separation (#5)
- Clip long file paths from the left using direction:rtl so filenames stay visible (#1)
- Add framer-motion AnimatePresence expand/collapse on feedback item detail (#3)
- Dim file links not found in current diff with tooltip fallback (#2)
- Fix file navigation to only scroll when target file exists in diff (#2)
- Add review seed data with resolved/pending items and thread messages (#4)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant