From 41e8e6fce47f2a008c84a8314ce60e976822fd8a Mon Sep 17 00:00:00 2001 From: lyon Date: Wed, 17 Jun 2026 00:55:24 +0800 Subject: [PATCH] fix: let web probe submit fresh prompts --- scripts/web-live-dom-probe.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/web-live-dom-probe.mjs b/scripts/web-live-dom-probe.mjs index 4a280992..9acd7e7e 100644 --- a/scripts/web-live-dom-probe.mjs +++ b/scripts/web-live-dom-probe.mjs @@ -665,7 +665,11 @@ async function collectSessionState(page) { async function submitPrompt(page, args, actions) { const readyBefore = await waitForCommandReady(page, args, actions); await page.locator("#command-input").fill(args.message); - await page.waitForFunction((expected) => document.querySelector("#command-input")?.value === expected, args.message, { timeout: Math.min(args.timeoutMs, 5000) }); + await page.waitForFunction((expected) => { + const input = document.querySelector("#command-input"); + const send = document.querySelector("#command-send"); + return input?.value === expected && send && !send.disabled; + }, args.message, { timeout: Math.min(args.timeoutMs, 5000) }); const afterFill = await collectCommandState(page); await page.locator("#command-send").click(); const afterClick = await collectCommandState(page); @@ -715,7 +719,7 @@ async function waitForCommandReady(page, args, actions) { const ready = await page.waitForFunction(() => { const input = document.querySelector("#command-input"); const send = document.querySelector("#command-send"); - return Boolean(input && send && !input.disabled && !send.disabled); + return Boolean(input && send && !input.disabled); }, null, { timeout: timeoutMs }).catch(() => null); const after = await collectCommandState(page); const result = { action: "command-ready", ready: Boolean(ready), timeoutMs, before, after };