Skip to content

Sort agents by status — active agents at the top #1145

@jrf0110

Description

@jrf0110

Parent

Part of #204 (Phase 4: Hardening)

Problem

Agent cards on both the town overview page and rig detail page are not sorted by status. Active (working) agents appear in arbitrary order alongside idle and exited agents. When a town has 10+ agents, finding the ones currently doing work requires scanning the entire list.

Solution

Sort agent cards by status with active agents at the top:

  1. working — currently processing a bead
  2. starting — being dispatched
  3. idle — available for work
  4. exited / failed — terminal states at the bottom

Within each status group, sort by last_activity_at descending (most recently active first).

Acceptance Criteria

  • Town overview page agent list sorted by status (working at top)
  • Rig detail page agent roster sorted by status (working at top)
  • Secondary sort by last_activity_at descending within each status group
  • Sort updates reactively as agent statuses change (no page refresh needed)

Notes

  • No data migration needed
  • This can be done client-side (sort the query results before rendering) or server-side (ORDER BY in the query). Client-side is simpler since the data is already fetched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestkilo-auto-fixAuto-generated label by Kilokilo-triagedAuto-generated label by Kilo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions