fix: select default source for mdtodo launch

This commit is contained in:
Codex
2026-06-30 13:32:07 +00:00
parent 639fb1e776
commit efb116f005
@@ -4132,8 +4132,11 @@ async function launchWorkbenchFromTask(command) {
const requestedFilename = commandValue(command, ["filename", "fileName"]);
const requestedTaskRef = typeof command.taskRef === "string" && command.taskRef.trim() ? command.taskRef.trim() : null;
const requestedTaskId = typeof command.taskId === "string" && command.taskId.trim() ? command.taskId.trim() : null;
const needsMdtodoSelection = Boolean(requestedFileRef || requestedFilename || requestedTaskRef || requestedTaskId);
const sourceSelection = requestedSourceId && initialProject.selectedSourceIdRaw !== requestedSourceId
? await selectMdtodoSource({ ...command, type: "selectMdtodoSource", sourceId: requestedSourceId })
: !requestedSourceId && needsMdtodoSelection && !initialProject.selectedSourceIdRaw
? await selectMdtodoSource({ ...command, type: "selectMdtodoSource", sourceId: "" })
: null;
const fileProject = sourceSelection ? await projectManagementCommandSnapshot({ includeRaw: true }) : initialProject;
const fileSelection = (requestedFileRef && fileProject.selectedFileRefRaw !== requestedFileRef) || requestedFilename