From 6bca20c934f5f236ec008093fb53b96841b18ca6 Mon Sep 17 00:00:00 2001 From: amoussa1229 <166072409+amoussa1229@users.noreply.github.com> Date: Thu, 2 Jul 2026 02:10:55 +0000 Subject: [PATCH] Fix approval ownership check and render decided cards Use thread.isOwner with a false fallback instead of comparing session login to thread.id. Render full approvals list so approved/rejected cards remain visible after mutation, rather than filtering to pending-only and hiding the transition state. Remove now-unused useSession import. --- ui/src/components/agents/AgentThreadView.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/src/components/agents/AgentThreadView.tsx b/ui/src/components/agents/AgentThreadView.tsx index a8bfa419..0080e8da 100644 --- a/ui/src/components/agents/AgentThreadView.tsx +++ b/ui/src/components/agents/AgentThreadView.tsx @@ -29,7 +29,6 @@ import { useWorkflowApprovals, } from "@/lib/agents/queries" import { WorkflowApprovalCard } from "@/components/agents/WorkflowApprovalCard" -import { useSession } from "@/lib/session" interface AgentThreadViewProps { thread: AgentThread @@ -136,12 +135,9 @@ export function AgentThreadView({ thread }: AgentThreadViewProps) { const approvalsQuery = useWorkflowApprovals(thread.id) const approveMutation = useApproveWorkflowPush(thread.id) const rejectMutation = useRejectWorkflowPush(thread.id) - const session = useSession() - const pendingApprovals = approvalsQuery.data?.filter( - (a) => a.status === "pending" - ) - const isApprovalOwner = thread.isOwner ?? session.data?.login === thread.id + const approvals = approvalsQuery.data + const isApprovalOwner = thread.isOwner ?? false const hasWorkflowApprovalError = useMemo( () => @@ -202,9 +198,9 @@ export function AgentThreadView({ thread }: AgentThreadViewProps) { )} {hasConversation ? (