fix(dashboard): stop agents in dashboard from moving during selection
This commit is contained in:
@@ -466,14 +466,20 @@ def enumerate_active_agents() -> list[ActiveAgent]:
|
|||||||
"""All currently-running agents, across every available
|
"""All currently-running agents, across every available
|
||||||
backend. Used by CLI `list active` and the dashboard's agents
|
backend. Used by CLI `list active` and the dashboard's agents
|
||||||
pane so neither has to know which backends exist. Skips
|
pane so neither has to know which backends exist. Skips
|
||||||
backends whose `is_available()` reports False. Ordered by
|
backends whose `is_available()` reports False.
|
||||||
backend name, then by whatever each backend's
|
|
||||||
`enumerate_active` returns."""
|
Sorted by `(started_at, slug)` so the list is stable across
|
||||||
|
dashboard refresh ticks — agents don't shift position while
|
||||||
|
the operator navigates with arrow keys. ISO 8601 timestamps
|
||||||
|
sort lexicographically in chronological order; `slug` is the
|
||||||
|
deterministic tiebreaker. Agents with missing metadata
|
||||||
|
(`started_at == ""`) sort first."""
|
||||||
out: list[ActiveAgent] = []
|
out: list[ActiveAgent] = []
|
||||||
for name in known_backend_names():
|
for name in known_backend_names():
|
||||||
if not has_backend(name):
|
if not has_backend(name):
|
||||||
continue
|
continue
|
||||||
out.extend(_BACKENDS[name].enumerate_active())
|
out.extend(_BACKENDS[name].enumerate_active())
|
||||||
|
out.sort(key=lambda a: (a.started_at, a.slug))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user