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.
This commit is contained in:
Louis Knight-Webb
2025-11-18 19:32:45 +00:00
committed by GitHub
parent 078554b5c7
commit 7fb00530c5

View File

@@ -92,9 +92,19 @@ const CreateAttemptDialogImpl = NiceModal.create<CreateAttemptDialogProps>(
const defaultProfile: ExecutorProfileId | null = useMemo(() => { const defaultProfile: ExecutorProfileId | null = useMemo(() => {
if (latestAttempt?.executor) { 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 { return {
executor: latestAttempt.executor as BaseCodingAgent, executor: lastExec,
variant: null, variant,
}; };
} }
return config?.executor_profile ?? null; return config?.executor_profile ?? null;