fix: bound sentinel submit action wait
This commit is contained in:
@@ -358,8 +358,9 @@ async function processCommand(command) {
|
||||
alternateResponsePaths: ["/v1/agent/chat/steer"],
|
||||
noActiveReason: "send-no-turn-composer",
|
||||
throwOnActionMismatch: true,
|
||||
expectedActionWaitMs: command.expectedActionWaitMs,
|
||||
}), "sendPrompt");
|
||||
case "steer": return withObserverSync(await sendPrompt(String(command.text || ""), { expectedAction: "steer", responsePath: "/v1/agent/chat/steer", noActiveReason: "steer-no-active-turn" }), "steer");
|
||||
case "steer": return withObserverSync(await sendPrompt(String(command.text || ""), { expectedAction: "steer", responsePath: "/v1/agent/chat/steer", noActiveReason: "steer-no-active-turn", expectedActionWaitMs: command.expectedActionWaitMs }), "steer");
|
||||
case "cancel": return withObserverSync(await cancelRunningTurn(), "cancel");
|
||||
case "selectProvider": return withObserverSync(await selectProvider(String(command.provider || command.value || command.text || "")), "selectProvider");
|
||||
case "clickSession": return withObserverSync(await clickSession(String(command.sessionId || command.value || "")), "clickSession");
|
||||
@@ -1520,8 +1521,11 @@ async function sendPrompt(text, options = {}) {
|
||||
].join(", ")).last();
|
||||
await submit.waitFor({ state: "visible", timeout: 15000 });
|
||||
if (options.expectedAction) {
|
||||
const actionWaitMs = Number.isFinite(Number(options.expectedActionWaitMs))
|
||||
? Math.max(1000, Math.trunc(Number(options.expectedActionWaitMs)))
|
||||
const configuredActionWaitMs = options.expectedActionWaitMs === null || options.expectedActionWaitMs === undefined || options.expectedActionWaitMs === ""
|
||||
? null
|
||||
: Number(options.expectedActionWaitMs);
|
||||
const actionWaitMs = Number.isFinite(configuredActionWaitMs)
|
||||
? Math.max(1000, Math.trunc(configuredActionWaitMs))
|
||||
: options.expectedAction === "turn" ? 180000 : 1000;
|
||||
const actionDeadline = Date.now() + actionWaitMs;
|
||||
let composer = null;
|
||||
@@ -3798,6 +3802,7 @@ function commandInputSummary(command) {
|
||||
severity: command.severity || null,
|
||||
alternateSessionStrategy: command.alternateSessionStrategy || null,
|
||||
expectedSentinelRange: command.expectedSentinelRange || null,
|
||||
expectedActionWaitMs: command.expectedActionWaitMs === null || command.expectedActionWaitMs === undefined || command.expectedActionWaitMs === "" ? null : Number(command.expectedActionWaitMs),
|
||||
requireComposerReady: command.requireComposerReady === true,
|
||||
findingId: command.findingId || null,
|
||||
blocking: command.blocking === true ? true : command.blocking === false ? false : null,
|
||||
|
||||
Reference in New Issue
Block a user