From 81b159e89216b335e5e269da72f1f786568fded5 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 30 Jun 2026 12:40:43 +0000 Subject: [PATCH] fix: improve JD01 mdtodo workbench web-probe --- config/hwlab-node-lanes.yaml | 4 +- scripts/src/hwlab-node-help.ts | 2 +- .../hwlab-node-web-observe-runner-source.ts | 40 +++++++++++++++++-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/config/hwlab-node-lanes.yaml b/config/hwlab-node-lanes.yaml index de5ca62a..c24e5581 100644 --- a/config/hwlab-node-lanes.yaml +++ b/config/hwlab-node-lanes.yaml @@ -190,7 +190,7 @@ lanes: projectManagementSource: config/hwlab-project-management/constart-71freq-mdtodo.yaml#projectManagement.sources[0] gatewayProfile: config/hwlab-gateway/constart-71freq-d601-v03.yaml#gateway.profile webProbe: - browserProxyMode: direct + browserProxyMode: auto defaultOrigin: mode: public baseUrl: https://hwlab.pikapython.com @@ -227,7 +227,7 @@ lanes: enabled: true blockerWindowMs: 30000 memory: - totalRssBlockerMb: 500 + totalRssBlockerMb: 800 processRssBlockerMb: 500 growthBlockerMb: 300 responsiveness: diff --git a/scripts/src/hwlab-node-help.ts b/scripts/src/hwlab-node-help.ts index 66dd6aea..c2a1c070 100644 --- a/scripts/src/hwlab-node-help.ts +++ b/scripts/src/hwlab-node-help.ts @@ -57,7 +57,7 @@ export function hwlabNodeWebProbeHelp(): Record { "bun scripts/cli.ts web-probe observe command webobs-xxxx --type openMdtodoReportPreview --task R1 --link R1.1", "bun scripts/cli.ts web-probe observe command webobs-xxxx --type toggleMdtodoReportFullscreen --text toggle", "bun scripts/cli.ts web-probe observe command webobs-xxxx --type editMdtodoTaskInline --task R1 --field body --text 'body updated through web-probe command'", - "bun scripts/cli.ts web-probe observe command webobs-xxxx --type launchWorkbenchFromMdtodo --task R1.1", + "bun scripts/cli.ts web-probe observe command webobs-xxxx --type launchWorkbenchFromMdtodo --filename 20260610-LVDT-旧过程归档.md --task R5.1 --provider dsflash-go", "bun scripts/cli.ts web-probe observe status webobs-xxxx", "bun scripts/cli.ts web-probe observe collect webobs-xxxx --view turn-summary", "bun scripts/cli.ts web-probe observe collect webobs-xxxx --view timeline --command-id cmd-xxxx", diff --git a/scripts/src/hwlab-node-web-observe-runner-source.ts b/scripts/src/hwlab-node-web-observe-runner-source.ts index 9d44c166..55c4c40e 100644 --- a/scripts/src/hwlab-node-web-observe-runner-source.ts +++ b/scripts/src/hwlab-node-web-observe-runner-source.ts @@ -3662,6 +3662,18 @@ async function selectTaskIfCommandTargetsOne(command) { return selectMdtodoTask(command); } +async function selectMdtodoProviderProfileForLaunch(command) { + const provider = commandValue(command, ["provider", "providerProfile"]); + if (!provider) return null; + const select = page.locator('[data-testid="mdtodo-provider-profile"]').first(); + if (!(await visibleLocator(select))) { + return { provider, visible: false, selected: null, valuesRedacted: true }; + } + const selected = await selectHtmlOptionByValueOrLabel(select, provider); + await page.waitForTimeout(300); + return { provider, visible: true, ...selected, valuesRedacted: true }; +} + async function saveMdtodoTaskWithButton(command, type, testId, fields) { ensureProjectManagementCommand(type); const beforeUrl = currentPageUrl(); @@ -3897,12 +3909,24 @@ async function launchWorkbenchFromTask(command) { const commandType = command.type === "launchWorkbenchFromMdtodo" ? "launchWorkbenchFromMdtodo" : "launchWorkbenchFromTask"; ensureProjectManagementCommand(commandType); const beforeUrl = currentPageUrl(); - const beforeProject = await projectManagementCommandSnapshot({ includeRaw: true }); + const initialProject = await projectManagementCommandSnapshot({ includeRaw: true }); + const requestedSourceId = commandValue(command, ["sourceId", "source"]); + const requestedFileRef = commandValue(command, ["fileRef"]); + 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; - if ((requestedTaskRef && beforeProject.selectedTaskRefRaw !== requestedTaskRef) || requestedTaskId) { - await selectMdtodoTask({ ...command, taskRef: requestedTaskRef }); - } + const sourceSelection = requestedSourceId && initialProject.selectedSourceIdRaw !== requestedSourceId + ? await selectMdtodoSource({ ...command, type: "selectMdtodoSource", sourceId: requestedSourceId }) + : null; + const fileProject = sourceSelection ? await projectManagementCommandSnapshot({ includeRaw: true }) : initialProject; + const fileSelection = (requestedFileRef && fileProject.selectedFileRefRaw !== requestedFileRef) || requestedFilename + ? await selectMdtodoFile({ ...command, type: "selectMdtodoFile", fileRef: requestedFileRef || command.fileRef, filename: requestedFilename || command.filename }) + : null; + const taskProject = fileSelection ? await projectManagementCommandSnapshot({ includeRaw: true }) : fileProject; + const taskSelection = (requestedTaskRef && taskProject.selectedTaskRefRaw !== requestedTaskRef) || requestedTaskId + ? await selectMdtodoTask({ ...command, type: "selectMdtodoTask", taskRef: requestedTaskRef || command.taskRef, taskId: requestedTaskId || command.taskId }) + : null; + const providerSelection = await selectMdtodoProviderProfileForLaunch(command); const projectBeforeClick = await projectManagementCommandSnapshot({ includeRaw: true }); const button = page.locator('[data-testid="mdtodo-workbench-launch"], [data-action="launch-workbench"]').first(); await button.waitFor({ state: "visible", timeout: 15000 }); @@ -4007,6 +4031,14 @@ async function launchWorkbenchFromTask(command) { chat, workbenchSnapshot, selectedTask: opaqueIdSummary(projectBeforeClick.selectedTaskRefRaw), + selection: { + source: sourceSelection, + file: fileSelection, + task: taskSelection, + provider: providerSelection, + valuesRedacted: true + }, + initialProject: sanitizeProjectCommandSnapshot(initialProject), projectBeforeClick: sanitizeProjectCommandSnapshot(projectBeforeClick), buttonState, responseParsed: payload !== null,