fix: let web probe submit fresh prompts

This commit is contained in:
lyon
2026-06-17 00:55:24 +08:00
parent e09d34dc8c
commit 41e8e6fce4
+6 -2
View File
@@ -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 };