From 9d8c0b286f2d3ed3b2fef99d762d416ad9a7372c Mon Sep 17 00:00:00 2001 From: Alex Netsch Date: Tue, 18 Nov 2025 10:23:49 +0000 Subject: [PATCH] Perfect! I've fixed the hook invalidation issue. (#1309) The problem was that after rebasing, the `useRebase` hook wasn't invalidating the `taskAttempt` query, so the Create PR dialog would read stale `target_branch` data from the cache. I added the missing invalidation at `frontend/src/hooks/useRebase.ts:43-46`, matching the pattern already used correctly in `useChangeTargetBranch.ts`. Now when a user rebases via the UI, the task attempt query will be invalidated and the Create PR dialog will show the updated target/base branch. --- frontend/src/hooks/useRebase.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/hooks/useRebase.ts b/frontend/src/hooks/useRebase.ts index 96426787..7cd594e4 100644 --- a/frontend/src/hooks/useRebase.ts +++ b/frontend/src/hooks/useRebase.ts @@ -40,6 +40,11 @@ export function useRebase( queryKey: ['branchStatus', attemptId], }); + // Invalidate taskAttempt query to refresh attempt.target_branch + queryClient.invalidateQueries({ + queryKey: ['taskAttempt', attemptId], + }); + // Refresh branch list used by PR dialog if (projectId) { queryClient.invalidateQueries({