Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(lent-screen): say plainly that a go-ahead does not lift the 30 s wait

AdityaUmalef9f0d5e043d4
diff --git a/electron/lent-screen-presence.mjs b/electron/lent-screen-presence.mjs
index 2c75f9eede..caf293e6e1 100644
--- a/electron/lent-screen-presence.mjs
+++ b/electron/lent-screen-presence.mjs
@@ -28,7 +28,10 @@ export function personActiveText(name) {
return `The person is using this computer right now, so ${name} was not performed: it would take their mouse, keyboard or front window. ` +
"Do it in the background instead: give the app's pid and window_id (from launch_app or list_windows) and act on an element from get_window_state, " +
"without delivery_mode \"foreground\" or scope \"desktop\". " +
- `If it can only be done in the foreground, wait until nobody has touched the computer for ${PERSON_AWAY_SECONDS} seconds, then observe it again and retry.`;
+ `If it can only be done in the foreground, it has to wait until nobody has touched this computer for ${PERSON_AWAY_SECONDS} seconds. ` +
+ "The person saying go ahead does not lift this wait, and typing that reply on this computer starts it again. " +
+ `So tell them plainly why and ask them to leave this computer untouched (no keyboard, mouse or trackpad) for ${PERSON_AWAY_SECONDS} seconds, ` +
+ "then observe it again and retry.";
}
/** `idleSeconds()`: seconds since the person last touched this computer, or null when this system cannot tell (then
diff --git a/electron/lent-screen-presence.node-test.mjs b/electron/lent-screen-presence.node-test.mjs
index 01840a909f..2d8e052201 100644
--- a/electron/lent-screen-presence.node-test.mjs
+++ b/electron/lent-screen-presence.node-test.mjs
@@ -53,3 +53,13 @@ test("the bot's own foreground input is not mistaken for the person; the person'
presence.acted("click", { pid: 42, window_id: 7, element_index: 1 });
assert.equal(presence.refusal("type_text", { text: "a" }), personActiveText("type_text"));
});
+
+test("the refusal tells the bot to ask the person to step away, since a go-ahead typed there restarts the wait", () => {
+ const text = personActiveText("click");
+ assert.match(text, /^The person is using this computer right now, so click was not performed/);
+ assert.match(text, /Do it in the background instead/);
+ assert.match(text, /saying go ahead does not lift this wait/);
+ assert.match(text, /typing that reply on this computer starts it again/);
+ assert.match(text, new RegExp(`ask them to leave this computer untouched \\(no keyboard, mouse or trackpad\\) for ${PERSON_AWAY_SECONDS} seconds`));
+ assert.match(text, /then observe it again and retry\.$/);
+});