From efb116f005ee3accc07782ad89f84f73df151840 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 30 Jun 2026 13:32:07 +0000 Subject: [PATCH] fix: select default source for mdtodo launch --- scripts/src/hwlab-node-web-observe-runner-source.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/src/hwlab-node-web-observe-runner-source.ts b/scripts/src/hwlab-node-web-observe-runner-source.ts index c1e5f288..cf8e3555 100644 --- a/scripts/src/hwlab-node-web-observe-runner-source.ts +++ b/scripts/src/hwlab-node-web-observe-runner-source.ts @@ -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