From 7fb00530c514d526ed3b31a3dea4a35c217e85bf Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Tue, 18 Nov 2025 19:32:45 +0000 Subject: [PATCH] I have applied the fix to `frontend/src/components/dialogs/tasks/CreateAttemptDialog.tsx`. (#1329) The new logic checks if the `latestAttempt`'s executor matches your configured default executor. If it does, it applies your configured variant (e.g. `VARIANT1`) instead of defaulting to `null`. If the executors differ, it safely falls back to the default variant. This ensures that when you create a new attempt on a task where you previously used your preferred agent, your preferred variant is now correctly pre-selected. --- .../dialogs/tasks/CreateAttemptDialog.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/dialogs/tasks/CreateAttemptDialog.tsx b/frontend/src/components/dialogs/tasks/CreateAttemptDialog.tsx index dbf27d1f..a2ddbcc1 100644 --- a/frontend/src/components/dialogs/tasks/CreateAttemptDialog.tsx +++ b/frontend/src/components/dialogs/tasks/CreateAttemptDialog.tsx @@ -92,9 +92,19 @@ const CreateAttemptDialogImpl = NiceModal.create( const defaultProfile: ExecutorProfileId | null = useMemo(() => { if (latestAttempt?.executor) { + const lastExec = latestAttempt.executor as BaseCodingAgent; + // If the last attempt used the same executor as the user's current preference, + // we assume they want to use their preferred variant as well. + // Otherwise, we default to the "default" variant (null) since we don't know + // what variant they used last time (TaskAttempt doesn't store it). + const variant = + config?.executor_profile?.executor === lastExec + ? config.executor_profile.variant + : null; + return { - executor: latestAttempt.executor as BaseCodingAgent, - variant: null, + executor: lastExec, + variant, }; } return config?.executor_profile ?? null;