refactor: decouple permission state from attention signal

This commit is contained in:
Mohamed Boudra
2026-02-23 15:47:08 +07:00
parent 89a117e1c1
commit f3ebe0545f
18 changed files with 276 additions and 28 deletions
@@ -924,6 +924,7 @@ function AgentScreenContent({
focusedAgentId,
isConnected,
requiresAttention: agent?.requiresAttention,
attentionReason: agent?.attentionReason,
})
) {
return;
@@ -29,6 +29,11 @@ export function AgentsScreen({ serverId }: { serverId: string }) {
const sortedAgents = useMemo(() => {
return [...agents].sort((a, b) => {
const aNeedsInput = (a.pendingPermissionCount ?? 0) > 0;
const bNeedsInput = (b.pendingPermissionCount ?? 0) > 0;
if (aNeedsInput && !bNeedsInput) return -1;
if (!aNeedsInput && bNeedsInput) return 1;
if (a.requiresAttention && !b.requiresAttention) return -1;
if (!a.requiresAttention && b.requiresAttention) return 1;
return 0;