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
@@ -3,6 +3,7 @@ interface ShouldClearAgentAttentionOnViewInput {
focusedAgentId: string | null | undefined;
isConnected: boolean;
requiresAttention: boolean | null | undefined;
attentionReason?: "finished" | "error" | "permission" | null | undefined;
}
export function shouldClearAgentAttentionOnView(
@@ -18,5 +19,8 @@ export function shouldClearAgentAttentionOnView(
if (!input.requiresAttention) {
return false;
}
if (input.attentionReason === "permission") {
return false;
}
return input.focusedAgentId === agentId;
}