From 30b27f8b4a08c7bec39d9bf3645ff7462d2c41b2 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Fri, 6 Mar 2026 14:13:42 +0100 Subject: [PATCH] fix: Conflict agent auto-dismiss fails on page load/remount prevStateRef was initialized with current state, so when the page loaded with an already-idle conflict agent, the transition guard was immediately false and dismiss() never fired. Initialize with null instead. --- apps/web/src/components/review/ConflictResolutionPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/review/ConflictResolutionPanel.tsx b/apps/web/src/components/review/ConflictResolutionPanel.tsx index cc55c06..ea2ff36 100644 --- a/apps/web/src/components/review/ConflictResolutionPanel.tsx +++ b/apps/web/src/components/review/ConflictResolutionPanel.tsx @@ -13,7 +13,7 @@ interface ConflictResolutionPanelProps { export function ConflictResolutionPanel({ initiativeId, conflicts, onResolved }: ConflictResolutionPanelProps) { const { state, agent, questions, spawn, resume, stop, dismiss } = useConflictAgent(initiativeId); const [showManual, setShowManual] = useState(false); - const prevStateRef = useRef(state); + const prevStateRef = useRef(null); // Auto-dismiss and re-check mergeability when conflict agent completes useEffect(() => {